venuss 0.0.2

Venus celestial simulation crate for the MilkyWay SolarSystem workspace
Documentation
use sciforge::hub::domain::common::constants::G;

pub struct VenusSatellite {
    pub name: &'static str,
    pub periapsis_km: f64,
    pub apoapsis_km: f64,
    pub inclination_deg: f64,
}

impl VenusSatellite {
    pub fn semi_major_axis_m(&self) -> f64 {
        ((self.periapsis_km + self.apoapsis_km) / 2.0) * 1000.0 + crate::VENUS_RADIUS
    }

    pub fn orbital_period_s(&self) -> f64 {
        let mu = G * crate::VENUS_MASS;
        let a = self.semi_major_axis_m();
        2.0 * std::f64::consts::PI * (a.powi(3) / mu).sqrt()
    }
}

pub fn venus_express() -> VenusSatellite {
    VenusSatellite {
        name: "Venus Express",
        periapsis_km: 250.0,
        apoapsis_km: 66_000.0,
        inclination_deg: 90.0,
    }
}

pub fn akatsuki() -> VenusSatellite {
    VenusSatellite {
        name: "Akatsuki",
        periapsis_km: 1000.0,
        apoapsis_km: 360_000.0,
        inclination_deg: 3.0,
    }
}