This library is only a couple of functions that are related: something to number lunations (back and forth). It's not hour-precise by itself. It will land within +/- 6 hours.
The equation was derived from this Wolfram page (archive link) to give me some sort of lunation numbering.
It looks like lunation #0 is the 1993-05-21 lunation (lunation #871 with a year 1923 epoch).
Make your Cargo.toml do something like this:
[dependencies]
lunations = {git = "https://github.com/arossbell/lunations"}
Inclusion:
extern crate lunations;
use lunations::*;
JD to lunation (f64 -> f64):
println!("{}", jd_lunation(2450744.365));
(Prints 54.715299381818
)
Lunation to JD (f64 -> f64):
println!("{}", lunation_jd(55.0));
(Prints 2450752.77237685
)
To make the JD of a lunation more precise, you could use the time_of_phase
function from the astro-rust crate.
- This code isn't (yet) that sophisticated.