moons 0.0.2

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

impl Crater {
    pub fn depth_to_diameter_ratio(&self) -> f64 {
        self.depth_km / self.diameter_km
    }
}

pub fn tycho() -> Crater {
    Crater {
        name: "Tycho",
        diameter_km: 85.0,
        depth_km: 4.8,
        age_gyr: 0.108,
    }
}

pub fn copernicus() -> Crater {
    Crater {
        name: "Copernicus",
        diameter_km: 93.0,
        depth_km: 3.8,
        age_gyr: 0.8,
    }
}

pub fn crater_class(diameter_km: f64) -> &'static str {
    if diameter_km < 15.0 {
        "simple"
    } else if diameter_km < 300.0 {
        "complex"
    } else {
        "basin"
    }
}