Coordinate Systems & Transformations
This section describes the coordinate reference frames used by the Spaceflight Dynamics Framework and the mathematical transformations implemented in the CoordinateTransformer class.
The framework uses a single simulation truth frame for physical propagation and derives all other coordinate representations from this state. This prevents conflicting state representations while still providing specialized frames for guidance, navigation, telemetry, visualization, and future orbital operations.
State Ownership and Frame Hierarchy
The translational state of the spacecraft is propagated in the Moon-Centered Inertial frame. The corresponding state vector is the single source of truth for spacecraft motion.
Where:
• is the spacecraft position in MCI [m]
• is the spacecraft velocity in MCI [m/s]
• is the body-to-inertial attitude quaternion
• is the angular velocity expressed in the spacecraft body frame [rad/s]
All other frames are derived views:
MCI ├── MCMF │ ├── MSC │ └── ENU │ ├── LVLH │ └── SBF
Reference Frame Definitions
MCI — Moon-Centered Inertial
The Moon-Centered Inertial frame is the primary physics frame of SDF. All translational dynamics are integrated in this frame.
Origin: Center of the Moon
Axes:
• +Z = Lunar North Pole
• +X = Prime Meridian at reference epoch
• +Y =
MCI is moon-centered, inertial, non-rotating, and right-handed.
MCMF — Moon-Centered Moon-Fixed
The Moon-Centered Moon-Fixed frame is attached to the lunar body and rotates with the Moon. It is used for surface-fixed locations, landing sites, and lunar geography.
Origin: Center of the Moon
Axes:
• +Z = Lunar North Pole
• +X = Current Prime Meridian
• +Y =
MCMF is moon-centered, rotating, surface-fixed, non-inertial, and right-handed.
MSC — Moon Surface Coordinates
Moon Surface Coordinates provide a geodetic representation of a lunar surface or near-surface location.
MSC is not a Cartesian frame. It is represented by latitude, longitude, and altitude:
Where:
• is lunar latitude [rad]
• is lunar longitude [rad]
• is altitude above the mean lunar radius [m]
ENU — East-North-Up
ENU is a local tangent frame attached to a mission reference point, typically the landing site. It is used for landing guidance, local navigation, and surface-relative telemetry.
Origin: Landing site
Axes:
• +X = East
• +Y = North
• +Z = Up
ENU is right-handed and locally defined. Its orientation depends on the chosen surface reference point.
LVLH — Local Vertical Local Horizontal
The LVLH frame is a spacecraft-centered orbital frame. It is useful for relative motion, rendezvous, docking, and orbital guidance.
Origin: Current spacecraft position
Axes:
• +X = Forward
• +Y = Right
• +Z = Down, toward the lunar center
The current implementation expresses LVLH velocities as projected relative velocities. Full rotating-frame velocity and acceleration terms are reserved for future high-fidelity dynamics.
SBF — Spacecraft Body Frame
The Spacecraft Body Frame is rigidly attached to the spacecraft and rotates with its attitude. It is the primary frame for propulsion, RCS, sensors, and control-related quantities.
Origin: Spacecraft center of mass
Axes:
• +X = Forward
• +Y = Right
• +Z = Down
Engine directions and RCS force directions are expressed in SBF. The current propulsion pipeline computes thrust in SBF and rotates it into MCI before passing it to the physics model.
MCI to MCMF Transformation
The MCMF frame rotates with the Moon relative to the inertial MCI frame. The lunar rotation angle is computed as:
Where:
• is the lunar sidereal rotation rate [rad/s]
• is simulation time [s]
The corresponding rotation quaternion is:
The position transformation is:
Since the target frame is rotating, the velocity transformation includes the transport term caused by the lunar angular velocity:
with:
MCMF to MCI Transformation
The inverse transformation rotates a Moon-fixed state back into the inertial frame. The inverse quaternion is used for the position mapping:
The inertial velocity is reconstructed by adding the rotating-frame velocity contribution:
MCMF to Moon Surface Coordinates
A Cartesian position in the Moon-fixed frame can be converted into geodetic Moon Surface Coordinates.
Given:
The radial distance is:
Latitude, longitude, and altitude are computed as:
Where is the mean lunar reference radius.
Moon Surface Coordinates to MCMF
The inverse mapping reconstructs the Moon-fixed Cartesian position from latitude, longitude, and altitude.
The resulting velocity is initialized as zero in MCMF, because a fixed surface location is stationary in the Moon-fixed frame.
ENU Frame Construction
The ENU frame is constructed from a reference state expressed in MCMF. In the current simulation, this reference state is typically the mission landing site.
The local up direction is the normalized radial direction:
A global reference axis is selected to construct the local tangent plane. Under nominal conditions, the lunar rotation axis is used:
The east and north directions are computed as:
Near the lunar poles, the implementation switches to a fallback reference axis to avoid singularities caused by nearly parallel vectors.
MCMF to ENU Transformation
To express a Moon-fixed spacecraft state in the local ENU frame, the relative vector from the ENU origin to the spacecraft is projected onto the ENU basis vectors.
The same projection is applied to relative velocity:
ENU to MCMF Transformation
The inverse transformation reconstructs a Moon-fixed Cartesian state from local ENU coordinates and the stored ENU frame basis.
LVLH Frame Construction
The LVLH frame is constructed from the current inertial spacecraft state. It is centered on the spacecraft and aligned with the local orbital geometry.
The down direction points toward the Moon center:
The orbital angular momentum vector is:
The right direction is defined as:
The forward direction completes the right-handed basis:
with .
If the angular momentum magnitude approaches zero, a fallback axis is used to avoid a degenerate frame definition.
MCI to LVLH Transformation
A target state is expressed in LVLH by projecting the relative inertial state onto the LVLH basis vectors.
The same projection is currently applied to relative velocity. This represents projected relative velocity, not the complete time derivative in a rotating LVLH frame.
LVLH to MCI Transformation
The inverse transformation reconstructs an inertial state from LVLH coordinates using the stored LVLH basis vectors.
MCI to SBF Transformation
The spacecraft body frame is defined by the spacecraft attitude quaternion and the current spacecraft origin state.
The body-to-inertial quaternion is denoted:
To transform an inertial state into the spacecraft body frame, the inverse attitude quaternion is applied to the relative state:
SBF to MCI Transformation
The inverse transformation maps body-frame coordinates back into the inertial MCI frame.
Generic Vector Transformations
Some quantities represent free vectors rather than position states. Examples include thrust vectors, acceleration vectors, sensor axes, and force directions.
Such quantities are rotated between frames without applying a translational origin offset.
This mechanism is used in the current thrust pipeline. Thrust is computed in SBF and rotated into MCI before it is passed to the physics model.
Implementation Characteristics
- MCI remains the single translational truth frame.
- MCMF is obtained by lunar rotation from MCI.
- MSC is derived from Moon-fixed Cartesian coordinates.
- ENU is generated from a local MCMF reference point.
- LVLH is computed from instantaneous MCI position and velocity.
- SBF is defined by spacecraft attitude and MCI origin state.
- Generic vector transformations apply rotation only.