#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum EuropaRegion {
    LeadingHemisphere,
    TrailingHemisphere,
    AntiJovian,
    SubJovian,
    NorthPolar,
    SouthPolar,
}

pub fn named_region(latitude_deg: f64, longitude_deg: f64) -> EuropaRegion {
    if latitude_deg > 70.0 {
        return EuropaRegion::NorthPolar;
    }
    if latitude_deg < -70.0 {
        return EuropaRegion::SouthPolar;
    }
    let lon_norm = longitude_deg.rem_euclid(360.0);
    if lon_norm > 315.0 || lon_norm <= 45.0 {
        EuropaRegion::SubJovian
    } else if (45.0..=135.0).contains(&lon_norm) {
        EuropaRegion::LeadingHemisphere
    } else if (135.0..=225.0).contains(&lon_norm) {
        EuropaRegion::AntiJovian
    } else {
        EuropaRegion::TrailingHemisphere
    }
}
