enceladuss 0.0.3

Enceladus celestial simulation crate for the MilkyWay SolarSystem workspace
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct ElevationSample {
    pub latitude_deg: f64,
    pub longitude_deg: f64,
    pub elevation_m: f64,
}

pub fn sample_dem(latitude_deg: f64, longitude_deg: f64) -> ElevationSample {
    let sulcus_depression = if latitude_deg < -55.0 { -200.0 } else { 0.0 };
    let north_crater_bias = if latitude_deg > 50.0 { -80.0 } else { 0.0 };
    let wave = latitude_deg.to_radians().sin() * 50.0 + longitude_deg.to_radians().cos() * 40.0;
    ElevationSample {
        latitude_deg,
        longitude_deg,
        elevation_m: sulcus_depression + north_crater_bias + wave,
    }
}