Function vsop87::keplerian_elements_from_vsop87 [] [src]

pub fn keplerian_elements_from_vsop87(a: f64, l: f64, k: f64, h: f64, q: f64, p: f64) -> (f64, f64, f64, f64, f64, f64)

Calculates the keplerian orbital elements from VSOP87

This function calculates the keplerian orbital elements from the VSOP87 solution (heliocentric ecliptic orbital elements for the equinox J2000.0). The parameters needed are the 6 variables returned by the VSOP87 function for a given planet. It returns, in order, a tuple with the keplerian orbital elements of the planet:

  • Eccentricity (e)
  • Semimajor axis (a), in AU
  • Inclination (i), in radians
  • Longitude of the ascending node (Ω), in radians
  • Longitude of the periapsis (ϖ), in radians
  • Mean longitude (L₀), in radians

Examples

let (a, l, k, h, q, p) = vsop87::mercury(2451545.0);
let (a, e, i, lan, lper, l) = vsop87::keplerian_elements_from_vsop87(a, l, k, h, q, p);

assert!(a > 0.387097 && a < 0.387099);
assert!(e > 0.205629 && e < 0.205631);
assert!(i > 0.122260 && i < 0.122261);
assert!(lan > 0.843525 && lan < 0.843527);
assert!(lper >  1.35183 && lper < 1.35185);
assert!(l > 4.40259 && l < 4.40261);