duras/msts
1
0
Fork
You've already forked msts
0
Geocentric lunar ephemeris library https://msts.vercel.app/
  • OCaml 96.4%
  • Dune 3.6%
2026年06月13日 06:01:38 +03:00
bin v0.1.0 2026年06月13日 06:01:38 +03:00
lib v0.1.0 2026年06月13日 06:01:38 +03:00
man v0.1.0 2026年06月13日 06:01:38 +03:00
test v0.1.0 2026年06月13日 06:01:38 +03:00
.gitignore v0.1.0 2026年06月13日 06:01:38 +03:00
CHANGES.md v0.1.0 2026年06月13日 06:01:38 +03:00
dune-project v0.1.0 2026年06月13日 06:01:38 +03:00
LICENSE v0.1.0 2026年06月13日 06:01:38 +03:00
msts.opam v0.1.0 2026年06月13日 06:01:38 +03:00
README.md v0.1.0 2026年06月13日 06:01:38 +03:00

msts

Geocentric lunar ephemeris library for OCaml.

Computes the Moon's ecliptic position and phase from a Unix timestamp.

No dependencies beyond the OCaml standard library.

Valid over 1900–2100, validated against JPL Horizons (DE441).

Requirements

  • OCaml ≥ 4.14
  • dune ≥ 3.17

Install

opam install msts

Use

let e = Msts.compute (Unix.gettimeofday ()) in
Printf.printf "%s %.1f%% %.0f km\n"
 (Msts.phase_name_to_string e.Msts.phase.Msts.name)
 (e.Msts.phase.Msts.illuminated_fraction *. 100.0)
 e.Msts.position.Msts.distance_km

Add to your dune file:

(libraries msts)

See man 3 msts for the full API reference.

License

ISC