My agentic slop goes here. Not intended for anyone else!
1(** Latitude module *)
2
3type t
4
5(** {2 Construction} *)
6
7val create : float -> t
8(** Raises Error.Coordinate_error if outside [-90, 90] *)
9
10val of_dms : degree:int -> minute:int -> second:float -> t
11
12val unsafe_create : float -> t
13(** No validation - use with caution *)
14
15val clamp : float -> t
16(** Clamp to valid range [-90, 90] *)
17
18(** {2 Accessors} *)
19
20val to_float : t -> float
21val degree : t -> int
22val minute : t -> int
23val second : t -> float
24val decimal_minute : t -> float
25val hemisphere : t -> [`N | `S]
26
27(** {2 Operations} *)
28
29val add : t -> float -> t
30val sub : t -> float -> t
31val neg : t -> t
32val abs : t -> float
33
34(** {2 Comparison} *)
35
36val equal : t -> t -> bool
37val compare : t -> t -> int
38val ( = ) : t -> t -> bool
39val ( < ) : t -> t -> bool
40val ( > ) : t -> t -> bool
41val ( <= ) : t -> t -> bool
42val ( >= ) : t -> t -> bool
43
44(** {2 Validation} *)
45
46val is_valid : float -> bool
47
48(** {2 Formatting} *)
49
50val to_string : t -> string
51(** Decimal degrees *)
52
53val format : ?precision:int -> t -> string
54(** With specified precision (default 6) *)
55
56val to_dms_string : t -> string
57(** Format as "DD°MM'SS.S\"N" *)