moons 0.0.2

Moon celestial simulation crate for the MilkyWay SolarSystem workspace
Documentation
use moons::temporal::calendar::LunarDate;
use moons::temporal::epoch::Epoch;
use moons::temporal::time_scale::TimeScale;

fn ensure_earth_context() {
    let earth_context = moons::interactions::earths::ensure_earths_binary_or_simulate();
    assert!(earth_context.rotation_angle_deg >= 0.0);
}

#[test]
fn lunation_day_wraps_after_one_month() {
    ensure_earth_context();
    let date = LunarDate::from_elapsed_days(35.0);
    assert!(date.day_in_lunation < 30.0);
}

#[test]
fn j2000_offset_is_zero_at_reference_epoch() {
    ensure_earth_context();
    assert_eq!(Epoch::from_julian_date(2_451_545.0).days_since_j2000(), 0.0);
}

#[test]
fn fast_forward_advances_more_time() {
    ensure_earth_context();
    let scale = TimeScale::fast_forward(120.0);
    assert_eq!(scale.advance_seconds(10.0), 1_200.0);
}