oberons 0.0.3

Oberon celestial simulation crate for the MilkyWay SolarSystem workspace
Documentation
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct UranusView {
    pub uranus_elevation_deg: f64,
    pub apparent_diameter_deg: f64,
    pub illuminated_fraction: f64,
}

impl UranusView {
    pub fn sub_uranus_default() -> Self {
        Self {
            uranus_elevation_deg: 89.0,
            apparent_diameter_deg: 4.5,
            illuminated_fraction: 0.70,
        }
    }
    pub fn is_visible(&self) -> bool {
        self.uranus_elevation_deg > 0.0
    }
}

pub fn uranusshine_gain(view: UranusView, surface_albedo: f64) -> f64 {
    if view.is_visible() {
        view.illuminated_fraction * view.apparent_diameter_deg * surface_albedo.max(0.0)
    } else {
        0.0
    }
}