moons 0.0.2

Moon celestial simulation crate for the MilkyWay SolarSystem workspace
Documentation
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct RegolithLayer {
    pub thickness_m: f64,
    pub density_kg_m3: f64,
    pub maturity: f64,
}

impl RegolithLayer {
    pub fn porosity(&self) -> f64 {
        (1.0 - self.density_kg_m3 / 3_100.0).clamp(0.0, 1.0)
    }

    pub fn thermal_inertia(&self) -> f64 {
        self.density_kg_m3 * (350.0 + 150.0 * self.maturity)
    }
}

pub fn mare_regolith() -> RegolithLayer {
    RegolithLayer {
        thickness_m: 4.0,
        density_kg_m3: 1_600.0,
        maturity: 0.7,
    }
}

pub fn highland_regolith() -> RegolithLayer {
    RegolithLayer {
        thickness_m: 12.0,
        density_kg_m3: 1_350.0,
        maturity: 0.85,
    }
}