moon-calc

Crates.iomoon-calc
lib.rsmoon-calc
version1.0.1
sourcesrc
created_at2023-07-02 21:42:40.165632
updated_at2023-11-17 03:05:35.86033
descriptionMoon phase calculator
homepagehttps://github.com/0elek/moon-calc
repositoryhttps://github.com/0elek/moon-calc
max_upload_size
id906443
size7,053
elek (0elek)

documentation

README

moon_calc

use moon_calc::Moon;
use std::time::SystemTime;

let moon = Moon::new(SystemTime::now());

moon.julian_date // julian date
moon.phase // phase 0 is new moon, 0.5 is full moon...
moon.age // age in days
moon.illumination // fraction of the moon that is illuminated 0 - 1
moon.lunation // lunation number https://robinfo.oma.be/en/astro-info/moon/lunation/
moon.distance // distance in earth radii

// functions 

moon.distance_km() // returns distance in km
moon.is_waning() // returns true if waning (decreasing)
moon.is_waxing() // returns true if waxing (increasing)
moon.phase_name() // returns name of phase
moon.phase_emoji() // returns emoji of phase in the northen hemisphere 

Commit count: 7

cargo fmt