europas 0.0.1

Europa 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 pwyll() -> Crater {
    Crater {
        name: "Pwyll",
        diameter_km: 26.0,
        depth_km: 0.6,
        age_gyr: 0.01,
    }
}

pub fn cilix() -> Crater {
    Crater {
        name: "Cilix",
        diameter_km: 19.0,
        depth_km: 0.4,
        age_gyr: 0.05,
    }
}

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