Solar and lunar orientation
Point a telescope at the Sun and you see a disk with no grid on it. To say where a sunspot is, or to come back to the same active region tomorrow, you need to know how the Sun’s rotation axis is tilted toward you and which solar meridian faces the Earth. The Moon has the same problem with a twist: its tilt and libration let you see a little around its edges, and the features near the limb come and go over the month.
The solar and lunar modules compute those orientation angles. The heliographic and
selenographic frames use them to put coordinates on the surfaces.
The Sun
use celestial_coords::frames::heliographic::{HeliographicCarrington, HeliographicStonyhurst};
use celestial_coords::solar::{carrington_rotation_number, compute_solar_orientation, sun_earth_distance};
use celestial_time::scales::conversions::{ToTAI, ToTT};
use celestial_time::scales::utc::UTC;
let tt = "2026-04-10T20:00:00Z".parse::<UTC>()?.to_tai()?.to_tt()?;
let sun = compute_solar_orientation(&tt)?;
println!("P {:+.2}°", sun.p.degrees());
println!("B0 {:+.2}°", sun.b0.degrees());
println!("L0 {:.2}°", sun.l0.degrees());
println!("rotation {:.4}", carrington_rotation_number(&tt)?);
println!("distance {:.6} au", sun_earth_distance(&tt)?);
// P -26.20°
// B0 -5.95°
// L0 63.85°
// rotation 2309.8226
// distance 1.001936 au
The three angles describe the disk you see:
- P is the position angle of the Sun’s rotation axis, measured from the north point of the disk toward the east. In April it’s -26°, so the solar north pole is tipped 26° to the west of celestial north.
- B0 is the heliographic latitude of the disk center. At -6° you see a little more of the southern hemisphere.
- L0 is the Carrington longitude of the disk center. It falls by about 13.2° a day as the Sun turns.
carrington_rotation_number counts solar rotations since Carrington’s first one in 1853.
The integer part is the rotation, and the fraction is how far into it the Sun has turned.
sun_earth_distance is the length of the Earth’s heliocentric position vector, in AU.
The angles follow Meeus, Astronomical Algorithms (2nd ed., ch. 29), with Carrington’s elements for the solar equator. The Earth’s position comes from the same series the aberration step uses. The tests reproduce Meeus’ worked example 29.a to the two decimal places he prints.
Coordinates on the Sun
Two frames put a grid on the solar surface:
HeliographicStonyhursthas longitude zero at the central meridian, the line through the disk center as seen from the Earth. A feature’s Stonyhurst longitude grows as the Sun carries it west across the disk.HeliographicCarringtonrotates with the Sun. A long-lived feature keeps roughly the same Carrington longitude from day to day.
The two differ by L0, so converting between them takes the epoch. Continuing the example above:
// A sunspot 20° west of the central meridian, 15° north
let spot = HeliographicStonyhurst::from_degrees(15.0, 20.0)?;
let fixed = spot.to_carrington(&tt)?;
println!("Carrington lon {:.2}°, lat {:.2}°", fixed.longitude().degrees(), fixed.latitude().degrees());
// Two days later, the same Carrington longitude has turned with the Sun
let later = "2026-04-12T20:00:00Z".parse::<UTC>()?.to_tai()?.to_tt()?;
let moved = HeliographicCarrington::from_degrees(15.0, fixed.longitude().degrees())?.to_stonyhurst(&later)?;
println!("Stonyhurst lon {:.2}° two days later", moved.longitude().degrees());
// Carrington lon 83.85°, lat 15.00°
// Stonyhurst lon 46.40° two days later
Both constructors take latitude first, then longitude. HeliographicStonyhurst::disk_center(&tt)
returns the point at B0 on the central meridian.
The Moon
use celestial_coords::frames::selenographic::SelenographicPosition;
use celestial_coords::lunar::compute_lunar_orientation;
use celestial_time::scales::conversions::{ToTAI, ToTT};
use celestial_time::scales::utc::UTC;
let tt = "2026-04-10T20:00:00Z".parse::<UTC>()?.to_tai()?.to_tt()?;
let moon = compute_lunar_orientation(&tt)?;
let (optical, total) = (&moon.optical_libration, &moon.sub_earth_point);
println!("optical libration l {:+.3}°, b {:+.3}°", optical.longitude.degrees(), optical.latitude.degrees());
println!("sub-Earth point l {:+.3}°, b {:+.3}°", total.longitude.degrees(), total.latitude.degrees());
println!("position angle {:.2}°", moon.position_angle.degrees());
// Mare Crisium, near the eastern limb
let crisium = SelenographicPosition::from_degrees(17.0, 59.1)?;
println!("Mare Crisium visible: {}", crisium.is_visible_from_earth(&tt)?);
let far = SelenographicPosition::farside_center();
println!("far side center visible: {}", far.is_visible_from_earth(&tt)?);
// optical libration l -5.342°, b +4.299°
// sub-Earth point l -5.374°, b +4.356°
// position angle 349.42°
// Mare Crisium visible: true
// far side center visible: false
The Moon keeps one face toward the Earth, but not exactly. Its orbit is elliptical and tilted against its equator, so over a month the Earth sees it from up to several degrees east, west, north and south of the mean face. That’s libration.
- Optical libration is the part that comes from the geometry of the orbit.
- The sub-Earth point adds the physical libration, the small real wobble of the Moon about its axis. It’s the selenographic longitude and latitude of the point that faces the Earth’s center.
- The position angle is the angle of the Moon’s rotation axis, from the north point of the disk toward the east.
compute_optical_libration and compute_sub_earth_point return the two libration pairs
on their own, for when you don’t need the position angle.
The libration and position angle follow Meeus ch. 53. The Moon’s position comes from
Meeus ch. 47, arranged to match ERFA’s eraMoon98. The tests reproduce Meeus’ worked
example 53.a to the precision he prints.
Coordinates on the Moon
SelenographicPosition holds a latitude and longitude on the Moon, latitude first.
Longitude is zero at the mean center of the near side and grows toward Mare Crisium.
sub_earth_point(&tt)returns the point facing the Earth.is_visible_from_earth(&tt)is true within 90° of that point.nearside_center,farside_center,north_poleandsouth_poleare fixed points.
Edge cases
- The
CoordinateFrameconversions for these frames rotate a direction. They don’t move its origin from the Earth to the Sun or Moon. Use them to turn a direction in ICRS axes into the body’s axes, not to find which point on the surface you’re looking at. to_stonyhurstreturns longitudes in [0°, 360°), so a feature 10° east of the central meridian comes back as 350°, not -10°.is_visible_from_earthuses the Earth’s center. From the surface you can see up to about a degree further around the limb.
Where next
- Ecliptic and Galactic coordinates for the mean ecliptic of date that these orientations start from.
- Planets, Sun and Moon for positions of the Sun and Moon.