moons 0.0.3

Moon celestial simulation crate for the MilkyWay SolarSystem workspace
Documentation
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct IceDeposit {
    pub crater_name: &'static str,
    pub estimated_mass_kg: f64,
    pub purity_fraction: f64,
}

impl IceDeposit {
    pub fn extractable_water_kg(&self, recovery_efficiency: f64) -> f64 {
        self.estimated_mass_kg * self.purity_fraction * recovery_efficiency.clamp(0.0, 1.0)
    }
}

pub fn shackleton_candidate() -> IceDeposit {
    IceDeposit {
        crater_name: "Shackleton",
        estimated_mass_kg: 6.0e9,
        purity_fraction: 0.62,
    }
}

pub fn annual_life_support_people(deposit: IceDeposit, kg_per_person_per_year: f64) -> f64 {
    deposit.extractable_water_kg(0.7) / kg_per_person_per_year.max(1.0)
}