Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Ecliptic and Galactic coordinates

Equatorial coordinates suit a telescope, because they follow the Earth’s axis. Other questions read better in other frames. Is this comet near the plane of the planets? Is this nebula in the Milky Way’s disk? celestial-coords has two frames for those: EclipticPosition, on the ecliptic and equinox of date, and GalacticPosition, on the plane of the Galaxy. Both convert through the ICRS with the CoordinateFrame trait.

use celestial_coords::frames::galactic::GalacticPosition;
use celestial_coords::frames::icrs::ICRSPosition;
use celestial_coords::transforms::CoordinateFrame;
use celestial_time::scales::tt::TT;

let epoch = TT::j2000(); // the Galactic frame ignores it

let center = GalacticPosition::galactic_center().to_icrs(&epoch)?;
println!("l = 0, b = 0      RA {:.6}°, Dec {:.6}°", center.ra().degrees(), center.dec().degrees());

let pole = GalacticPosition::north_galactic_pole().to_icrs(&epoch)?;
println!("b = 90°           RA {:.6}°, Dec {:.6}°", pole.ra().degrees(), pole.dec().degrees());

let deneb = ICRSPosition::from_degrees(310.35797975, 45.28033881)?;
let g = deneb.to_galactic(&epoch)?;
println!("Deneb             l {:.4}°, b {:.4}°", g.longitude().degrees(), g.latitude().degrees());
println!("near the plane: {}", g.is_near_galactic_plane());
// l = 0, b = 0      RA 266.404995°, Dec -28.936174°
// b = 90°           RA 192.859480°, Dec 27.128250°
// Deneb             l 84.2847°, b 1.9975°
// near the plane: true

Galactic coordinates

Galactic longitude l runs along the plane of the Milky Way from the direction of the Galactic center, and latitude b runs from that plane. The frame is fixed, so the epoch argument to to_icrs and from_icrs doesn’t change the result.

The rotation is the one the Hipparcos Catalogue (ESA 1997, vol. 1 §1.5.3) ties to the ICRS, with the north Galactic pole at RA 192.85948°, Dec 27.12825°, as the example shows. The tests match ERFA’s eraIcrs2g and eraG2icrs exactly.

GalacticPosition has constructors for the center, the anticenter and both poles, and a few rough classifiers for survey work:

  • is_near_galactic_plane() is true for |b| < 10°.
  • is_in_galactic_bulge() is true for |b| < 10° and l within 30° of the center.
  • is_near_galactic_pole() is true for |b| > 80°.

Ecliptic coordinates of date

Ecliptic longitude λ runs along the plane of the Earth’s orbit from the equinox, and latitude β runs from that plane. The equinox moves with precession, so ecliptic longitudes of date grow by about 50″ a year:

use celestial_coords::frames::icrs::ICRSPosition;
use celestial_core::constants::{J2000_JD, MJD_ZERO_POINT};
use celestial_time::julian::JulianDate;
use celestial_time::scales::tt::TT;

let regulus = ICRSPosition::from_degrees(152.09296244, 11.96720878)?;

for (label, epoch) in [
    ("J2000.0   ", TT::j2000()),
    ("2026-01-01", TT::from_julian_date(JulianDate::new(MJD_ZERO_POINT, 61041.0))),
    ("J2100.0   ", TT::from_julian_date(JulianDate::new(J2000_JD, 36525.0))),
] {
    let e = regulus.to_ecliptic(&epoch)?;
    println!("{label}  λ {:.4}°, β {:+.4}°", e.lambda().degrees(), e.beta().degrees());
}
// J2000.0     λ 149.8291°, β +0.4648°
// 2026-01-01  λ 150.1924°, β +0.4663°
// J2100.0     λ 151.2264°, β +0.4703°

Regulus is 0.46° from the ecliptic, close enough that the Moon passes in front of it. Over a century its latitude changes by 0.005° and its longitude by 1.4°. The latitude moves because the ecliptic plane itself tilts slowly.

EclipticPosition uses the mean ecliptic and equinox of date: IAU 2006 precession and the IAU 2006 mean obliquity, with no nutation. That’s the frame ERFA’s eraEqec06 and eraEceq06 use, and the tests match them. The position carries its epoch, and its to_icrs uses that epoch.

Obliquity and fixed points

An EclipticPosition can report the obliquity for its epoch:

use celestial_coords::frames::ecliptic::EclipticPosition;
use celestial_coords::transforms::CoordinateFrame;
use celestial_core::angle::DmsFmt;
use celestial_core::constants::MJD_ZERO_POINT;
use celestial_time::julian::JulianDate;
use celestial_time::scales::tt::TT;

let epoch = TT::from_julian_date(JulianDate::new(MJD_ZERO_POINT, 61041.0));
let fmt = DmsFmt { frac_digits: 3 };

let solstice = EclipticPosition::summer_solstice(epoch);
println!("mean obliquity {}", fmt.fmt(solstice.mean_obliquity()?));
println!("true obliquity {}", fmt.fmt(solstice.true_obliquity()?));

let icrs = solstice.to_icrs(&epoch)?;
println!("RA {:.4}°, Dec {:.4}°", icrs.ra().degrees(), icrs.dec().degrees());
// mean obliquity +23° 26' 9.228"
// true obliquity +23° 26' 17.294"
// RA 89.6041°, Dec 23.4354°

true_obliquity adds the IAU 2006/2000A nutation in obliquity. The frame itself stays on the mean ecliptic. The June solstice point of 2026 is at RA 89.6° on ICRS axes, not 90°, because the equinox has precessed since J2000.0. Precession, nutation and obliquity covers the obliquity models.

The other fixed points are vernal_equinox, autumnal_equinox, winter_solstice, north_ecliptic_pole and south_ecliptic_pole, all for a given epoch.

The fixed J2000.0 ecliptic

The planetary theories work on a different ecliptic: the fixed VSOP2013 frame of J2000.0. For heliocentric vectors in that frame, use frames::ecliptic_cartesian::EclipticCartesian with the CartesianFrame trait from transforms::cartesian. It calls the rotation that Ecliptic coordinates describes.

Distances

ICRSPosition, GalacticPosition and EclipticPosition can each hold a Distance, and the conversions copy it across unchanged. distance::Distance converts between parsecs, light years, AU, kilometers, parallax and distance modulus. Constructors reject zero, negative and non-finite values.

Edge cases

  • Longitudes come back in [0°, 360°). Latitudes outside ±90° are rejected.
  • At a pole, longitude has no meaning. The conversions return whatever longitude the rounding produces, and two poles with different longitudes can show a separation of about 1e-16 rad.
  • EclipticPosition::to_icrs ignores its epoch argument and uses the position’s own epoch.

Where next