Function vsop87::mars [] [src]

pub fn mars(jde: f64) -> VSOP87Elements

Calculates VSOP87 solution for Mars.

This function calculates the VSOP87 solution (heliocentric ecliptic orbital elements for the equinox J2000.0) for the planet Mars. 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 planet Mars. In this case, we calculate the orbit of Mars in December 19th, 1199.

let vsop87_elts = vsop87::mars(2159345.0);

assert!(vsop87_elts.a > 1.5237578877 && vsop87_elts.a < 1.5237578879);
assert!(vsop87_elts.l > 4.0669853278 && vsop87_elts.l < 4.0669853280);
assert!(vsop87_elts.k > 0.0821906316 && vsop87_elts.k < 0.0821906318);
assert!(vsop87_elts.h > -0.0427917583 && vsop87_elts.h < -0.0427917581);
assert!(vsop87_elts.q > 0.0103081045 && vsop87_elts.q < 0.0103081047);
assert!(vsop87_elts.p > 0.01313608 && vsop87_elts.p < 0.01313684);

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);