[−][src]Function vsop87::vsop87a::mars
pub fn mars(jde: f64) -> RectangularCoordinates
Calculates VSOP87A solution for Mars.
This function calculates the VSOP87A solution (heliocentric ecliptic rectangular coordinates
for the equinox J2000.0) for the planet Mars. 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 planet Mars in the solar system using rectangular coordinates. In this case, we calculate where Mars was in December 19th, 1399.
use vsop87::vsop87a; let coordinates = vsop87a::mars(2232395.0); assert!(coordinates.x > 1.3910394545 && coordinates.x < 1.3910394547); assert!(coordinates.y > -0.0543839268 && coordinates.y < -0.0543839266); assert!(coordinates.z > -0.037103 && coordinates.z < -0.037099);