Function vsop87::vsop87a::earth_moon
source · pub fn earth_moon(jde: f64) -> RectangularCoordinates
Expand description
Calculates VSOP87A solution for Earth - Moon barycenter.
This function calculates the VSOP87A solution (heliocentric ecliptic rectangular coordinates
for the equinox J2000.0) for the Earth - Moon barycenter or center of masses. The parameter
needed is the Julian Day (JD) for the given date. It returns the VSOP87A solution in a
RectangularCoordinates
structure. Those values are the rectangular coordinates of the planet,
in AU, with the Sun in the center and the ecliptic plane as reference z = 0
.
Example
Given a date in JD, we can get the position of the Earth - Moon barycenter in the solar system using rectangular coordinates. In this case, we calculate where the barycenter was in December 19th, 1199.
use vsop87::vsop87a;
let coordinates = vsop87a::earth_moon(2159345.0);
assert!(coordinates.x > -0.2654471687 && coordinates.x < -0.2654471685);
assert!(coordinates.y > 0.9464953235 && coordinates.y < 0.9464953237);
assert!(coordinates.z > 0.001703 && coordinates.z < 0.001707);