callistos 0.0.2

Callisto 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 valhalla() -> Crater {
    Crater {
        name: "Valhalla",
        diameter_km: 3800.0,
        depth_km: 2.5,
        age_gyr: 4.0,
    }
}

pub fn asgard() -> Crater {
    Crater {
        name: "Asgard",
        diameter_km: 1600.0,
        depth_km: 1.8,
        age_gyr: 3.9,
    }
}

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