ganymedes 0.0.3

Ganymede celestial simulation crate for the MilkyWay SolarSystem workspace
Documentation
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct IceDeposit {
    pub region_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 bright_terrain_deposit() -> IceDeposit {
    IceDeposit {
        region_name: "Bright terrain subsurface",
        estimated_mass_kg: 8.0e13,
        purity_fraction: 0.55,
    }
}

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)
}