···177177178178let period el = if el.a <= 0. then infinity (* hyperbolic *) else twopi /. el.n
179179let eccentricity el = el.e
180180+let semi_major_axis el = el.a
181181+let inclination el = el.i
182182+let pp ppf el = Fmt.pf ppf "a=%.3f km e=%.6f i=%.4f rad" el.a el.e el.i
180183181184(** {1 Public API} *)
182185
+9
lib/analytic.mli
···2222val eccentricity : elements -> float
2323(** [eccentricity el] is the orbital eccentricity. *)
24242525+val semi_major_axis : elements -> float
2626+(** [semi_major_axis el] is the semi-major axis in km. *)
2727+2828+val inclination : elements -> float
2929+(** [inclination el] is the orbital inclination in radians. *)
3030+3131+val pp : elements Fmt.t
3232+(** Pretty-print orbital elements. *)
3333+2534(** {1 Propagation} *)
26352736val at : pos:Vec3.t -> vel:Vec3.t -> dt:float -> Vec3.t
+12
lib/vec3.ml
···2222 }
23232424let length v = sqrt ((v.x *. v.x) +. (v.y *. v.y) +. (v.z *. v.z))
2525+2626+let normalize v =
2727+ let n = length v in
2828+ if n < 1e-15 then v else scale (1.0 /. n) v
2929+3030+let negate v = { x = -.v.x; y = -.v.y; z = -.v.z }
3131+3232+let equal ?(eps = 1e-12) a b =
3333+ Float.abs (a.x -. b.x) <= eps
3434+ && Float.abs (a.y -. b.y) <= eps
3535+ && Float.abs (a.z -. b.z) <= eps
3636+2537let pp ppf v = Fmt.pf ppf "(%g, %g, %g)" v.x v.y v.z
+15-1
lib/vec3.mli
···11-(** 3D vector operations. *)
11+(** 3D vector operations.
22+33+ Provides basic arithmetic, products, and comparison for three-component
44+ floating-point vectors used throughout the orbital mechanics libraries. *)
2536type t = { x : float; y : float; z : float }
47···25282629val length : t -> float
2730(** [length v] is the Euclidean length. *)
3131+3232+val normalize : t -> t
3333+(** [normalize v] returns the unit vector in the direction of [v]. Returns [v]
3434+ unchanged if its length is near zero. *)
3535+3636+val negate : t -> t
3737+(** [negate v] is the component-wise negation of [v]. *)
3838+3939+val equal : ?eps:float -> t -> t -> bool
4040+(** [equal ?eps a b] is [true] when each component differs by at most [eps]
4141+ (default [1e-12]). *)
28422943val pp : t Fmt.t
3044(** [pp] pretty-prints a vector. *)