Skip to main content

from_ecliptic

Function from_ecliptic 

Source
pub fn from_ecliptic(e: Ecliptic, at: OffsetDateTime) -> Equatorial
Expand description

Equatorial (J2000) position of mean-ecliptic-of-date coordinates at instant at. Inverse of to_ecliptic.

use skymath::{from_ecliptic, separation, to_ecliptic, Equatorial, ParseMode};
use time::OffsetDateTime;

let m31 = Equatorial::parse_j2000("00:42:44.3", "+41:16:09", ParseMode::Strict)?;
let now = OffsetDateTime::now_utc();
let round_tripped = from_ecliptic(to_ecliptic(m31, now), now);
assert!(separation(m31, round_tripped).arcseconds() < 1e-6);