Frame Conversions¶
Purpose¶
This specification defines the mathematical contract for LuPNT frame
conversion functions such as ConvertFrame,
GetFrameRotationTranslation, and the Earth/Moon frame-specific conversion
helpers. The key requirements are explicit epoch scale, frame origin,
rotation, translation, and velocity conventions.
Epoch Contract¶
Frame conversions use epochs expressed as TDB seconds from the LuPNT epoch origin:
If an input time is in another time scale, it must be converted to TDB before calling frame conversion functions. Earth-orientation internals convert from TDB to TT, UT1, or UTC as needed to evaluate precession-nutation, Earth rotation, polar motion, and EOP corrections.
Affine Position Transform¶
For position-only conversions, LuPNT represents the mapping from frame \(A\) to frame \(B\) as an affine transform:
Here \(R_{BA}\) rotates vector components from frame \(A\) axes into frame \(B\) axes, and \(p_{BA}\) is the position of the origin of frame \(A\) expressed in frame \(B\).
GetFrameRotationTranslation returns exactly the pair
\((R_{BA}, p_{BA})\).
Cartesian State Transform¶
For a Cartesian state, the full transform is
For a pure time-dependent rotation and translation,
GetFrameRotationTranslationRv returns the affine six-state equivalent
\((R_{6,BA}, p_{6,BA})\) by applying ConvertFrame to the Cartesian
basis states and the zero state.
Rotate-Only Mode¶
When rotate_only is true, ConvertFrame applies only the rotation
returned by GetFrameRotationTranslation:
This mode is useful for vector-like quantities such as accelerations or local
offsets where the origin velocity terms should not be applied. For ordinary
position-velocity state transformations, rotate_only should be false.
Frame Graph¶
The implemented native conversion graph is centered on GCRF and MOON_CI:
Earth-fixed and Earth inertial frames attach through GCRF:
Lunar fixed and lunar orbit-plane frames attach through MOON_CI:
The Earth-Moon rotating frame EMR attaches through GCRF.
Frame Centers¶
Each supported frame has a natural center used by ephemeris and conversion helpers:
GCRF and ICRF¶
GCRF and ICRF are related by the Earth barycentric state. If \(r_{\mathrm{SSB}\rightarrow E}\) and \(v_{\mathrm{SSB}\rightarrow E}\) are evaluated from planetary ephemerides in GCRF axes, then
The inverse subtracts the same Earth barycentric state.
GCRF and ITRF¶
The native GCRF-to-ITRF rotation is
Here \(R_\mathrm{PN}\) is the IAU precession-nutation rotation, \(R_\mathrm{ERA}\) is Earth rotation from UT1, and \(R_\mathrm{polar}\) is polar motion from EOP data.
The position and velocity mapping is
The inverse is
GCRF and EME¶
GCRF and EME are related by the Earth frame-bias rotation
The same static rotation is applied to both position and velocity.
GCRF and MOON_CI¶
MOON_CI is Moon-centered and axis-aligned with the inertial GCRF axes. Let \(r_{E\rightarrow M}\) and \(v_{E\rightarrow M}\) be the Moon state relative to Earth. Then
The inverse adds the same Earth-to-Moon state.
MOON_CI and MOON_PA¶
MOON_PA is the Moon principal-axis fixed frame. The native rotation is represented by lunar mantle libration angles \((\phi,\theta,\psi)\):
The velocity transform includes the exact derivative of this rotation:
The inverse subtracts the rotation-rate contribution before applying the transpose rotation.
MOON_PA and MOON_ME¶
MOON_ME is related to MOON_PA through a static bias rotation:
The same static rotation is applied to both position and velocity.
MOON_OP¶
MOON_OP is the lunar orbit-plane frame. It is built from the Moon-to-Earth state and the Moon mean-Earth pole. Let
and let \(\hat{p}\) be the Moon ME z-axis expressed in MOON_CI. Then
The rotation from MOON_OP to MOON_CI is
The current implementation applies this rotation to both position and velocity without an explicit \(\dot{R}\) term for MOON_OP.
SPICE-Fitted Orientation Option¶
InitFrameConversionFromSpice can fit the native Earth and lunar
orientation paths to SPICE over a requested TDB time window. It samples SPICE
rotations at Chebyshev-Gauss nodes and fits ZXZ Euler angles
\((\phi,\theta,\psi)\) over piecewise Chebyshev segments:
At evaluation time the fitted angles reconstruct
and \(\dot{R}(t)\) is obtained by differentiating the Chebyshev polynomials and applying the product rule. The reconstructed rotation remains orthonormal to floating-point precision because it is a product of elementary rotation matrices.
If the requested epoch is outside the fitted time window, LuPNT falls back to the native analytic Earth or lunar orientation model.
Coordinate Scale and Units¶
Frame conversion functions themselves do not change numerical units. If the input state is in kilometers, the output is in kilometers. If it is in meters, the output is in meters.
Ephemeris helpers such as GetBodyPosVel can additionally scale positions
and gravitational parameters between supported coordinate scales. For a
constant coordinate scale factor \(F\), LuPNT uses
Frame conversion callers are responsible for keeping coordinate scale and unit choices consistent with the states being transformed.