ECI and Satellite Local Frames

This package provides functions to compute the rotation between an Earth-Centered Inertial (ECI) reference frame and two satellite-centered local frames: the Hill frame (also known as RSW or RTN) and the Local Vertical, Local Horizontal (LVLH) frame. Both frames are defined by the satellite position and velocity represented in the ECI frame, and both share the orbital plane. The along-track axis is aligned with the velocity vector only in circular orbits; in general, it is the direction in the orbital plane that is perpendicular to the radial direction and positive toward the direction of motion.

All the functions in this page can return a Direction Cosine Matrix (DCM) or a Quaternion. The rotation description is selected by the first argument T. If T is omitted, then it defaults to DCM. The state can be provided as the position and velocity vectors or as an OrbitStateVector.

Note

The functions throw an ArgumentError if the position and velocity vectors are parallel or if any of them is zero, since the frames are undefined in this case.

Hill Frame (RSW / RTN)

The Hill frame is centered at the satellite and its axes are defined as follows:

  • The X axis (R) points along the radial direction, from the Earth's center to the satellite;
  • The Y axis (S) points along the along-track direction; and
  • The Z axis (W) points along the orbit angular momentum vector, completing the right-handed frame.

The rotations between an ECI frame and the Hill frame are computed by:

r_eci_to_hill([T, ]r_eci::AbstractVector, v_eci::AbstractVector) -> T
r_eci_to_hill([T, ]sv::OrbitStateVector) -> T
r_hill_to_eci([T, ]r_eci::AbstractVector, v_eci::AbstractVector) -> T
r_hill_to_eci([T, ]sv::OrbitStateVector) -> T

where r_eci [m] and v_eci [m/s] are the satellite position and velocity represented in the ECI frame, or sv is the orbit state vector whose position and velocity are represented in the ECI frame.

julia> r_eci = [3e6, 4e6, 0.0];
julia> v_eci = [-1e3, 2e3, 2e3];
julia> D_hill_eci = r_eci_to_hill(r_eci, v_eci)DCM{Float64}: 0.6 0.8 0.0 -0.565685 0.424264 0.707107 0.565685 -0.424264 0.707107
julia> D_hill_eci * r_eci3-element StaticArraysCore.SVector{3, Float64} with indices SOneTo(3): 5.0e6 5.454126039694529e-11 -4.375522166810697e-11
julia> r_eci_to_hill(Quaternion, r_eci, v_eci)Quaternion{Float64}: + 0.826343 + 0.342282⋅i + 0.171141⋅j + 0.413171⋅k
julia> sv = OrbitStateVector(0.0, r_eci, v_eci);
julia> r_eci_to_hill(sv)DCM{Float64}: 0.6 0.8 0.0 -0.565685 0.424264 0.707107 0.565685 -0.424264 0.707107
julia> r_hill_to_eci(r_eci, v_eci)DCM{Float64}: 0.6 -0.565685 0.565685 0.8 0.424264 -0.424264 0.0 0.707107 0.707107

LVLH Frame

The LVLH frame is centered at the satellite and its axes are defined as follows:

  • The X axis points along the along-track direction;
  • The Y axis points opposite to the orbit angular momentum vector, completing the right-handed frame; and
  • The Z axis points along the nadir direction, from the satellite to the Earth's center.

Hence, the LVLH frame is a permutation of the Hill frame axes: x_lvlh = y_hill, y_lvlh = -z_hill, and z_lvlh = -x_hill.

The rotations between an ECI frame and the LVLH frame are computed by:

r_eci_to_lvlh([T, ]r_eci::AbstractVector, v_eci::AbstractVector) -> T
r_eci_to_lvlh([T, ]sv::OrbitStateVector) -> T
r_lvlh_to_eci([T, ]r_eci::AbstractVector, v_eci::AbstractVector) -> T
r_lvlh_to_eci([T, ]sv::OrbitStateVector) -> T

where the arguments have the same meaning as in the Hill frame functions.

julia> D_lvlh_eci = r_eci_to_lvlh(r_eci, v_eci)DCM{Float64}:
 -0.565685   0.424264   0.707107
 -0.565685   0.424264  -0.707107
 -0.6       -0.8       -0.0
julia> D_lvlh_eci * r_eci3-element StaticArraysCore.SVector{3, Float64} with indices SOneTo(3): 5.454126039694529e-11 4.375522166810697e-11 -5.0e6
julia> r_eci_to_lvlh(Quaternion, r_eci, v_eci)Quaternion{Float64}: + 0.463298 + 0.0501261⋅i - 0.705328⋅j + 0.534187⋅k
julia> r_eci_to_lvlh(sv)DCM{Float64}: -0.565685 0.424264 0.707107 -0.565685 0.424264 -0.707107 -0.6 -0.8 -0.0
julia> r_lvlh_to_eci(r_eci, v_eci)DCM{Float64}: -0.565685 -0.565685 -0.6 0.424264 0.424264 -0.8 0.707107 -0.707107 -0.0