#[derive(Debug, Clone, Copy, PartialEq)]
pub struct IceRegolith {
    pub thickness_m: f64,
    pub density_kg_m3: f64,
    pub ice_fraction: f64,
}

impl IceRegolith {
    pub fn porosity(&self) -> f64 {
        (1.0 - self.density_kg_m3 / 917.0).clamp(0.0, 1.0)
    }

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

pub fn leading_hemisphere_regolith() -> IceRegolith {
    IceRegolith {
        thickness_m: 3.0,
        density_kg_m3: 550.0,
        ice_fraction: 0.98,
    }
}

pub fn trailing_hemisphere_regolith() -> IceRegolith {
    IceRegolith {
        thickness_m: 4.0,
        density_kg_m3: 600.0,
        ice_fraction: 0.92,
    }
}
