#[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 voltaire() -> Crater {
    Crater {
        name: "Voltaire",
        diameter_km: 1.9,
        depth_km: 0.3,
        age_gyr: 3.5,
    }
}

pub fn swift() -> Crater {
    Crater {
        name: "Swift",
        diameter_km: 1.0,
        depth_km: 0.15,
        age_gyr: 3.2,
    }
}

pub fn crater_class(diameter_km: f64) -> &'static str {
    if diameter_km < 0.5 {
        "simple"
    } else if diameter_km < 2.0 {
        "complex"
    } else {
        "large"
    }
}
