Computing the classical orbital elements from the state vector, position and velocity (Curtis section 4.4, algorithm 4.2).

The Map

  • [𝐫̇𝐫]⟶[𝑎𝑒𝑖Ω𝜔𝜃(𝑡)]

Vectors First

  1. Angular momentum vector:
    • 𝐡=𝐫×̇𝐫
  2. Semilatus rectum:
    • 𝑝=ℎ2𝜇
  3. Eccentricity vector:
    • 𝐞=̇𝐫×𝐡𝜇−̂𝐫
  4. Node direction (toward the ascending node):
    • ̂𝐧=̂𝐊×𝐡|̂𝐊×𝐡|
  • Then the size and shape:
    • 𝑒=|𝐞|
    • 𝑎=(2𝑟−𝑣2𝜇)−1=𝑝1−𝑒2

RAAN and Inclination

  • RAAN, quadrant-safe with the two-argument arctangent:
    • Ω=arctan(̂𝐧⋅̂𝐉,̂𝐧⋅̂𝐈)
  • or, from the cosine with a quadrant check:
    • cosΩ=𝑛𝐼
    • {𝑛𝐽<0⇒𝜋<Ω<2𝜋𝑛𝐽>0⇒0<Ω<𝜋
  • Inclination:
    • cos𝑖=̂𝐡⋅̂𝐊,0≤𝑖≤180°
    • no quadrant check needed: arccos already covers 0 to 180°

Argument of Perigee

  • Angle between the ascending node ̂𝐧 and ̂𝐞:
    • cos𝜔=̂𝐧⋅̂𝐞
  • If 𝑒𝐾<0, then the perigee is below the equatorial plane:
    • 𝜋≤𝜔≤2𝜋

True Anomaly

  • Angle between ̂𝐞 and ̂𝐫, or from the orbit equation:
    • cos𝜃=̂𝐫⋅̂𝐞=1𝑒(𝑝𝑟−1)
  • If 𝐫⋅̇𝐫<0, then the true anomaly is below the apse line (major axis), so
    • 𝜋≤𝜃≤2𝜋
    • 𝐫⋅̇𝐫=𝑟̇𝑟 (radial rate): negative radial velocity means the satellite is heading back toward perigee
  • These give us the orbital elements from the orbital state vector, position and velocity
  • The reverse direction: State Vector from Orbital Elements

Singular cases

  • ̂𝐧 is undefined for 𝑖=0 (̂𝐊×𝐡=0) and ̂𝐞 for 𝑒=0: then Ω, 𝜔, 𝜃 are undefined; use Equinoctial Elements