#[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 primary_crater() -> Crater {
    Crater {
        name: "Stickney",
        diameter_km: 9.0,
        depth_km: 1.5,
        age_gyr: 3.5,
    }
}

pub fn secondary_crater() -> Crater {
    Crater {
        name: "Limtoc",
        diameter_km: 2.0,
        depth_km: 0.3,
        age_gyr: 3.0,
    }
}

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"
    }
}
