Skip to content

sduras/msts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Geocentric lunar ephemeris library

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors