[][src]Function vsop87::earth_moon

pub fn earth_moon(jde: f64) -> VSOP87Elements

Calculates VSOP87 solution for Earth - Moon barycenter.

This function calculates the VSOP87 solution (heliocentric ecliptic orbital elements for the equinox J2000.0) for the Earth - Moon barycenter. The parameter needed is the Julian Day (JD) for the given date. It returns the VSOP87Elements of the VSOP87 solution.

Example

Given a date in JD, we can get the orbit of the Earth - Moon barycenter (the center of masses between the Earth and the Moon, not exactly the center of the Earth). In this case, we calculate the orbit of the Earth - Moon barycenter in December 19th, 1099.

let vsop87_elts = vsop87::earth_moon(2122820.0);

assert!(vsop87_elts.a > 1.0000134925 && vsop87_elts.a < 1.0000134927);
assert!(vsop87_elts.l > 1.8519621672 && vsop87_elts.l < 1.8519621674);
assert!(vsop87_elts.k > -0.0029638176 && vsop87_elts.k < -0.0029638174);
assert!(vsop87_elts.h > 0.0168402193 && vsop87_elts.h < 0.0168402195);
assert!(vsop87_elts.q > 0.0010301900 && vsop87_elts.q < 0.0010301902);
assert!(vsop87_elts.p > -0.00005346 && vsop87_elts.p < -0.00005270);

It can then be converted into keplerian elements:

use vsop87::{KeplerianElements, VSOP87Elements};

let k_elements: KeplerianElements = vsop87_elts.into();
let convert_back = VSOP87Elements::from(k_elements);