#[derive(Debug, Clone, Copy, PartialEq)]
pub struct NeptuneView {
pub neptune_elevation_deg: f64,
pub apparent_diameter_deg: f64,
pub illuminated_fraction: f64,
}
impl NeptuneView {
pub fn sub_neptune_default() -> Self {
Self {
neptune_elevation_deg: 89.0,
apparent_diameter_deg: 4.5,
illuminated_fraction: 0.70,
}
}
pub fn is_visible(&self) -> bool {
self.neptune_elevation_deg > 0.0
}
}
pub fn neptuneshine_gain(view: NeptuneView, surface_albedo: f64) -> f64 {
if view.is_visible() {
view.illuminated_fraction * view.apparent_diameter_deg * surface_albedo.max(0.0)
} else {
0.0
}
}