moons 0.0.1

Moon celestial simulation crate for the MilkyWay SolarSystem workspace
Documentation
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct LavaPlain {
    pub name: &'static str,
    pub area_km2: f64,
    pub mean_thickness_m: f64,
    pub age_gyr: f64,
}

impl LavaPlain {
    pub fn volume_km3(&self) -> f64 {
        self.area_km2 * self.mean_thickness_m / 1_000.0
    }
}

pub fn mare_serenitatis() -> LavaPlain {
    LavaPlain {
        name: "Mare Serenitatis",
        area_km2: 303_000.0,
        mean_thickness_m: 800.0,
        age_gyr: 3.85,
    }
}

pub fn eruption_duration_years(flow_thickness_m: f64, emplacement_rate_m_yr: f64) -> f64 {
    flow_thickness_m / emplacement_rate_m_yr.max(1e-6)
}