[][src]Function vsop87::vsop87b::earth

pub fn earth(jde: f64) -> SphericalCoordinates

Calculates VSOP87B solution for Earth.

This function calculates the VSOP87B solution (heliocentric ecliptic spherical coordinates for the equinox J2000.0) for the planet Earth. The parameter needed is the Julian Day (JD) for the given date. It returns the VSOP87B solution ina SphericalCoordinates struct. Those values are the spherical coordinates of the planet, with the Sun in the center and the ecliptic plane as reference latitude = 0.

Example

Given a date in JD, we can get the position of the planet Earth in the solar system using spherical coordinates. In this case, we calculate where the Earth was in December 30th, 1799.

use vsop87::vsop87b;

let coordinates = vsop87b::earth(2378495.0);

assert!(coordinates.longitude() > 1.7750058557 && coordinates.longitude() < 1.7750058559);
assert!(coordinates.latitude() > 0.0004381094 && coordinates.latitude() < 0.0004381096);
assert!(coordinates.distance() > 0.9832270 && coordinates.distance() < 0.9832278);