Astronomy and Space Exploration ES

Higher Education / Celestial mechanics

Orbital elements and state ↔ elements conversion

The six Keplerian elements, the perifocal frame and the rotation matrices R₃(−Ω)R₁(−i)R₃(−ω); conversion algorithms in both directions with degenerate cases, verified against the state vector of Mars at J2000 (JPL Horizons).

⏱ 150 min rotation matricesEuler anglescross productatan2 and quadrant ambiguitynumerical conditioning revision

By the end you will be able to:
  • Define the six Keplerian elements (a, e, i, Ω, ω, τ or M₀) and their geometric meaning with respect to a reference plane and direction.
  • Construct the perifocal → inertial rotation matrix as the product of three 3-1-3 Euler rotations and prove its properties.
  • Implement and justify the state → elements and elements → state algorithms, including the equatorial and circular cases.
  • Reproduce the osculating elements of Mars published by JPL Horizons from its state vector.
  • Analyze the conditioning of the conversion as e → 0 or i → 0 and know the equinoctial elements as a remedy.

1. Motivation

Illustration: Motivation

A state vector (r,v)(\mathbf r, \mathbf v) fixes the orbit, but its six numbers change at every instant and say nothing at a glance. The orbital elements are another parametrization of the same six constants: five describe the geometry of the conic and its orientation in space, and are constant in the two-body problem; the sixth says where the body is. The JPL ephemerides, the asteroid catalogs and the TLEs of satellites are published in elements; converting in both directions is the most basic operation in astrodynamics.

2. The six Keplerian elements

Illustration: The six Keplerian elements

We fix an inertial frame (x^,y^,z^)(\hat{\mathbf x}, \hat{\mathbf y}, \hat{\mathbf z}): the xyxy plane is the reference plane (the J2000 ecliptic for heliocentric orbits, the ICRF equator for Earth satellites) and x^\hat{\mathbf x} points toward the vernal equinox γ\gamma of J2000. With h=r×v\mathbf h = \mathbf r\times\mathbf v and A=v×h−μr^\mathbf A = \mathbf v\times\mathbf h - \mu\hat{\mathbf r} (lesson 0):

ElementDefinitionWhat it fixes
aasemi-major axis, a=−μ/(2ε)a = -\mu/(2\varepsilon)size
eeeccentricity, e=A/μe = A/\mushape
iiinclination, cos⁡i=hz/h\cos i = h_z/h, i∈[0,π]i\in[0,\pi]tilt of the orbital plane
Ω\Omegalongitude of the ascending node, angle from x^\hat{\mathbf x} to n=z^×h\mathbf n = \hat{\mathbf z}\times\mathbf horientation of the line of nodes
ω\omegaargument of periapsis, angle from n\mathbf n to A\mathbf A in the orbital planeorientation of the ellipse within its plane
ν\nu, MM or τ\tautrue / mean anomaly, or time of periapsis passageposition along the orbit

The vector n=z^×h=(−hy,hx,0)\mathbf n = \hat{\mathbf z}\times\mathbf h = (-h_y, h_x, 0) lies on the intersection of the two planes and points toward the ascending node, the point where the body crosses the reference plane toward z>0z > 0 (Problem 2). An orbit is prograde if i<90°i < 90° and retrograde if i>90°i > 90°. The angles Ω\Omega and ω\omega are measured in the direction of motion, in [0,2π)[0, 2\pi). As an alternative to ω\omega and ν\nu one uses the longitude of periapsis ϖ=Ω+ω\varpi = \Omega + \omega and the mean longitude λ=ϖ+M\lambda = \varpi + M, which remain defined as i→0i\to0.

3. The perifocal frame and the rotation matrices

Illustration: The perifocal frame and the rotation matrices

In the perifocal frame (p^,q^,w^)(\hat{\mathbf p}, \hat{\mathbf q}, \hat{\mathbf w}), with p^=A/A\hat{\mathbf p} = \mathbf A/A toward periapsis, w^=h/h\hat{\mathbf w} = \mathbf h/h and q^=w^×p^\hat{\mathbf q} = \hat{\mathbf w}\times\hat{\mathbf p}, the orbit is planar and its description is that of lesson 0:

rpf=p1+ecos⁡ν(cos⁡νsin⁡ν0),vpf=μp(−sin⁡νe+cos⁡ν0),\mathbf r_{pf} = \frac{p}{1+e\cos\nu}\begin{pmatrix}\cos\nu\\ \sin\nu\\ 0\end{pmatrix}, \qquad \mathbf v_{pf} = \sqrt{\frac{\mu}{p}}\begin{pmatrix}-\sin\nu\\ e+\cos\nu\\ 0\end{pmatrix},

(the second one is the hodograph of Problem 3 in lesson 0). To go to the inertial frame, three rotations must be undone. We define the passive rotations (the axes rotate, not the vector) about xx and about zz:

R1(θ)=(1000cos⁡θsin⁡θ0−sin⁡θcos⁡θ),R3(θ)=(cos⁡θsin⁡θ0−sin⁡θcos⁡θ0001).R_1(\theta) = \begin{pmatrix}1&0&0\\0&\cos\theta&\sin\theta\\0&-\sin\theta&\cos\theta\end{pmatrix}, \qquad R_3(\theta) = \begin{pmatrix}\cos\theta&\sin\theta&0\\-\sin\theta&\cos\theta&0\\0&0&1\end{pmatrix}.

From the inertial frame to the perifocal one we go through the Euler 3-1-3 sequence: rotate by Ω\Omega about z^\hat{\mathbf z} (now x^′\hat{\mathbf x}' points toward the node), rotate by ii about the line of nodes (now z^′′=w^\hat{\mathbf z}'' = \hat{\mathbf w}) and rotate by ω\omega about w^\hat{\mathbf w} (now x^′′′=p^\hat{\mathbf x}''' = \hat{\mathbf p}). In components, rpf=R3(ω)R1(i)R3(Ω) r\mathbf r_{pf} = R_3(\omega)R_1(i)R_3(\Omega)\,\mathbf r. Since each RkR_k is orthogonal, the inverse is the transpose, Rk(θ)−1=Rk(θ)T=Rk(−θ)R_k(\theta)^{-1} = R_k(\theta)^T = R_k(-\theta), and

  r=Q rpf,Q=R3(−Ω) R1(−i) R3(−ω)  \boxed{\;\mathbf r = Q\,\mathbf r_{pf}, \qquad Q = R_3(-\Omega)\,R_1(-i)\,R_3(-\omega)\;}

Multiplying out (Problem 1) one obtains the explicit matrix, with cΩ=cos⁡Ωc_\Omega = \cos\Omega, sΩ=sin⁡Ωs_\Omega = \sin\Omega, etc.:

Q=(cΩcω−sΩsωci−cΩsω−sΩcωcisΩsisΩcω+cΩsωci−sΩsω+cΩcωci−cΩsisωsicωsici).Q = \begin{pmatrix} c_\Omega c_\omega - s_\Omega s_\omega c_i & -c_\Omega s_\omega - s_\Omega c_\omega c_i & s_\Omega s_i\\ s_\Omega c_\omega + c_\Omega s_\omega c_i & -s_\Omega s_\omega + c_\Omega c_\omega c_i & -c_\Omega s_i\\ s_\omega s_i & c_\omega s_i & c_i \end{pmatrix}.

Its columns are p^\hat{\mathbf p}, q^\hat{\mathbf q}, w^\hat{\mathbf w} expressed in the inertial frame; in particular the third column is h/h\mathbf h/h, which gives an immediate check of any implementation (the test of elementos.ts uses it). The same QQ transforms velocities, because the rotation is constant in time.

4. Algorithm: state → elements

Illustration: Algorithm: state → elements

Given r\mathbf r, v\mathbf v, μ\mu (Curtis, algorithm 4.2; Vallado, algorithm 9):

  1. h=r×v\mathbf h = \mathbf r\times\mathbf v, h=∥h∥h = \lVert\mathbf h\rVert;  n=z^×h\ \mathbf n = \hat{\mathbf z}\times\mathbf h, n=∥n∥n = \lVert\mathbf n\rVert.
  2. e=(v×h)/μ−r/r\mathbf e = (\mathbf v\times\mathbf h)/\mu - \mathbf r/r, e=∥e∥e = \lVert\mathbf e\rVert;  ε=v2/2−μ/r\ \varepsilon = v^2/2 - \mu/r, a=−μ/(2ε)a = -\mu/(2\varepsilon) (if e≠1e \ne 1), p=h2/μp = h^2/\mu.
  3. i=arccos⁡(hz/h)i = \arccos(h_z/h). Since h>0h > 0 and i∈[0,π]i\in[0,\pi], there is no ambiguity.
  4. Ω=atan2⁡(ny,nx)\Omega = \operatorname{atan2}(n_y, n_x), brought into [0,2π)[0, 2\pi). (Equivalent to arccos⁡(nx/n)\arccos(n_x/n) with the correction Ω→2π−Ω\Omega \to 2\pi - \Omega if ny<0n_y < 0.)
  5. ω=arccos⁡((n⋅e)/(ne))\omega = \arccos\big((\mathbf n\cdot\mathbf e)/(n e)\big), and ω→2π−ω\omega \to 2\pi - \omega if ez<0e_z < 0 (periapsis lies below the reference plane).
  6. ν=arccos⁡((e⋅r)/(er))\nu = \arccos\big((\mathbf e\cdot\mathbf r)/(e r)\big), and ν→2π−ν\nu \to 2\pi - \nu if r⋅v<0\mathbf r\cdot\mathbf v < 0 (the body is approaching periapsis).
  7. If MM is wanted: E=2atan2⁡(1−e sin⁡ν2, 1+e cos⁡ν2)E = 2\operatorname{atan2}\big(\sqrt{1-e}\,\sin\tfrac\nu2,\ \sqrt{1+e}\,\cos\tfrac\nu2\big) and M=E−esin⁡EM = E - e\sin E; the periapsis passage is τ=t−M/n\tau = t - M/n.

Degenerate cases. If i=0i = 0 or π\pi, n=0\mathbf n = \mathbf 0 and Ω\Omega does not exist: one takes Ω=0\Omega = 0 and ω\omega is measured from x^\hat{\mathbf x} (it is the longitude of periapsis ϖ\varpi). If e=0e = 0, ω\omega does not exist: one takes ω=0\omega = 0 and ν\nu is measured from the node (argument of latitude u=ω+νu = \omega + \nu). If both occur, ν\nu is measured from x^\hat{\mathbf x} (true longitude). In the implementation one must decide with a tolerance (e<10−10e < 10^{-10}, n<10−10hn < 10^{-10}h) and document it: section 7 explains why.

5. Algorithm: elements → state

Illustration: Algorithm: elements → state

Given a,e,i,Ω,ωa, e, i, \Omega, \omega and ν\nu (or MM, solving Kepler’s equation to obtain EE and then ν\nu):

  1. p=a(1−e2)p = a(1-e^2), r=p/(1+ecos⁡ν)r = p/(1+e\cos\nu).
  2. rpf\mathbf r_{pf} and vpf\mathbf v_{pf} as in section 3.
  3. r=Q rpf\mathbf r = Q\,\mathbf r_{pf}, v=Q vpf\mathbf v = Q\,\mathbf v_{pf} with Q=R3(−Ω)R1(−i)R3(−ω)Q = R_3(-\Omega)R_1(-i)R_3(-\omega).

To propagate the orbit over an interval Δt\Delta t it suffices to change M→M+n ΔtM \to M + n\,\Delta t and redo step 3: no other element varies in the two-body problem. This is the cheapest and most accurate way to propagate a Keplerian orbit (there is no integration error, only that of solving Kepler’s equation, which is round-off).

6. Verification: Mars at J2000

Illustration: Verification: Mars at J2000

We start from the Horizons vector (lesson 0, section 6) and apply the algorithm of section 4. We compare with the Horizons ELEMENTS table for the same epoch and the same frame (ecliptic J2000, Sun center, μ=1.3271248287×1011\mu = 1.3271248287\times10^{11} km³/s²):

ElementComputedHorizonsDifference
aa (km)227 939 132.97227\,939\,132.97227 939 132.97227\,939\,132.97<10−2< 10^{-2} km
ee0.0933151014580.0933151014580.0933151014580.093315101458<10−12< 10^{-12}
ii (°)1.84987647711.84987647711.84987647711.8498764771<10−10< 10^{-10}
Ω\Omega (°)49.562005658649.562005658649.562005658649.5620056586<10−10< 10^{-10}
ω\omega (°)286.5373830862286.5373830862286.5373830862286.5373830862<10−10< 10^{-10}
ν\nu (°)23.333196644123.333196644123.333196644123.3331966441<10−10< 10^{-10}
MM (°)19.356482747319.356482747319.356482747319.3564827473<10−10< 10^{-10}
τ\tau (JD)2451508.0629232451508.0629232451508.0629232451508.062923<10−6< 10^{-6} d

The agreement is at the level of the rounding of the input data (16 figures). The perihelion passage, τ=2451545.0−M/n\tau = 2451545.0 - M/n with n=6.0652706×10−6n = 6.0652706\times10^{-6} °/s =1.0585894×10−7= 1.0585894\times10^{-7} rad/s, falls on November 25, 1999. The inverse conversion returns the original vector with an error below 1 cm in position and 10−910^{-9} km/s in velocity (“round-trip” test).

Osculating vs. mean. These are osculating elements: those of the conic tangent to the real trajectory at that instant. One month later Horizons gives slightly different values because Jupiter and the other planets perturb Mars. For Earth the effect is even more visible: its vector at J2000 gives a=1.49665×108a = 1.49665\times10^{8} km (not 1 au) and i=4.2×10−4i = 4.2\times10^{-4} degrees (not 0), because the center of the Earth orbits the Earth–Moon barycenter (lesson 0, Problem 6).

7. Numerical analysis: conditioning

Illustration: Numerical analysis: conditioning

Quadrants. Formulas with arccos⁡\arccos return angles in [0,π][0,\pi]; without the sign corrections of steps 4–6 one gets the wrong angle half of the time. With atan2⁡\operatorname{atan2} the problem is avoided at the root: for example ν=atan2⁡(esin⁡ν, ecos⁡ν)\nu = \operatorname{atan2}(e\sin\nu,\ e\cos\nu) with ecos⁡ν=p/r−1e\cos\nu = p/r - 1 and esin⁡ν=(r⋅v) h/(μr)e\sin\nu = (\mathbf r\cdot\mathbf v)\,h/(\mu r), which is moreover robust as e→0e\to0.

Singularities. Ω\Omega is obtained from n\mathbf n, whose magnitude is hsin⁡ih\sin i; as i→0i\to0 the computation divides by a small number and the error in Ω\Omega grows as 1/sin⁡i1/\sin i: for Earth (i=4.18×10−4i = 4.18\times10^{-4}°) the amplification factor is 1/sin⁡i≈1.4×1051/\sin i \approx 1.4\times10^{5}. Likewise, ω\omega and ν\nu are obtained from e\mathbf e and their error grows as 1/e1/e. The sums ϖ=Ω+ω\varpi = \Omega+\omega and λ=ϖ+M\lambda = \varpi + M are, by contrast, well defined and well conditioned: the opposite errors of Ω\Omega and ω\omega cancel. This motivates the equinoctial elements (Broucke & Cefola 1972):

he=esin⁡ϖ,ke=ecos⁡ϖ,pe=tan⁡i2sin⁡Ω,qe=tan⁡i2cos⁡Ω,λ,h_e = e\sin\varpi,\quad k_e = e\cos\varpi,\quad p_e = \tan\tfrac i2\sin\Omega,\quad q_e = \tan\tfrac i2\cos\Omega,\quad \lambda,

together with aa: they are continuous and nonsingular for e=0e = 0 and i=0i = 0 (they fail only at i=180°i = 180°), and they are the ones used by modern semi-analytical propagators.

Tolerances. The decision "e=0e = 0" with a threshold of 10−1010^{-10} introduces a discontinuity: for e=1.1×10−10e = 1.1\times10^{-10} one computes ω\omega (with relative error ϵmach/e∼10−6\epsilon_{\text{mach}}/e \sim 10^{-6}) and for e=0.9×10−10e = 0.9\times10^{-10} one sets ω=0\omega = 0. The physical quantities (r\mathbf r, v\mathbf v, ϖ+ν\varpi+\nu) are continuous across the threshold; only the partition into ω\omega and ν\nu jumps. A good unit test checks precisely that.

8. Simulator

Period T = 1.000 years · t = 0.000 years · r = 0.000 au · v = 0.00 km/s

The simulator works in the perifocal plane (the xx axis points toward periapsis). Set a=1.5237a = 1.5237 au and e=0.0933e = 0.0933 to see the orbit of Mars in its own plane; what is missing to place it in space is exactly ii, Ω\Omega and ω\omega: the matrix QQ. Check that with e=0e = 0 the position of periapsis (and hence ω\omega) ceases to be meaningful.

Problems

  1. (Proof) Multiply R3(−Ω)R1(−i)R3(−ω)R_3(-\Omega)R_1(-i)R_3(-\omega) and obtain the matrix QQ of section 3. Check that QTQ=IQ^TQ = I, that det⁡Q=1\det Q = 1 and that its third column is (sin⁡Ωsin⁡i, −cos⁡Ωsin⁡i, cos⁡i)(\sin\Omega\sin i,\ -\cos\Omega\sin i,\ \cos i). Interpret the latter.
Show solution

R1(−i)R3(−ω)R_1(-i)R_3(-\omega) has rows (cω,−sω,0)(c_\omega, -s_\omega, 0), (cisω,cicω,−si)(c_i s_\omega, c_i c_\omega, -s_i), (sisω,sicω,ci)(s_i s_\omega, s_i c_\omega, c_i); multiplying on the left by R3(−Ω)R_3(-\Omega) gives the entries in the text. A product of orthogonal matrices is orthogonal and det⁡\det of each RkR_k is cos⁡2+sin⁡2=1\cos^2+\sin^2 = 1. The third column is Qz^pf=w^=h/hQ\hat{\mathbf z}_{pf} = \hat{\mathbf w} = \mathbf h/h: the pole of the orbit, which makes an angle ii with z^\hat{\mathbf z} and whose projection onto the reference plane is perpendicular to the line of nodes (hence sin⁡Ω\sin\Omega, −cos⁡Ω-\cos\Omega).

  1. (Proof) Show that n=z^×h\mathbf n = \hat{\mathbf z}\times\mathbf h points toward the ascending node and not the descending one.
Show solution

At the ascending node, r=rn^\mathbf r = r\hat{\mathbf n} and vz>0v_z > 0. Since n⊥h\mathbf n\perp\mathbf h and n⊥z^\mathbf n\perp\hat{\mathbf z}, n\mathbf n lies on the line of nodes; what remains is the sense. We evaluate n⋅r\mathbf n\cdot\mathbf r at the ascending node: n⋅r=(z^×h)⋅r=z^⋅(h×r)\mathbf n\cdot\mathbf r = (\hat{\mathbf z}\times\mathbf h)\cdot\mathbf r = \hat{\mathbf z}\cdot(\mathbf h\times\mathbf r). With h=r×v\mathbf h = \mathbf r\times\mathbf v: h×r=(r×v)×r=vr2−r(r⋅v)\mathbf h\times\mathbf r = (\mathbf r\times\mathbf v)\times\mathbf r = \mathbf v r^2 - \mathbf r(\mathbf r\cdot\mathbf v). Its zz component at the node (where z=0z = 0) is vzr2>0v_zr^2 > 0. Hence n⋅r>0\mathbf n\cdot\mathbf r > 0: n\mathbf n and the ascending node are on the same side.

  1. (Quadrants) Justify the two sign corrections: ω→2π−ω\omega\to2\pi-\omega if ez<0e_z < 0 and ν→2π−ν\nu\to2\pi-\nu if r⋅v<0\mathbf r\cdot\mathbf v < 0.
Show solution

ω\omega is measured from n\mathbf n in the direction of motion. The points of the orbit with 0<ω+ν<π0 < \omega + \nu < \pi (half a turn after the ascending node) have z>0z > 0; therefore periapsis has ez>0e_z > 0 if ω∈(0,π)\omega\in(0,\pi) and ez<0e_z < 0 if ω∈(π,2π)\omega\in(\pi,2\pi). For ν\nu: r⋅v=rr˙\mathbf r\cdot\mathbf v = r\dot r, and r˙=(μ/h) esin⁡ν\dot r = (\mu/h)\,e\sin\nu (lesson 0, Problem 1), so r˙<0⇔sin⁡ν<0⇔ν∈(π,2π)\dot r < 0 \Leftrightarrow \sin\nu < 0 \Leftrightarrow \nu\in(\pi,2\pi).

  1. (Propagation) With the elements of Mars at J2000, compute its true anomaly and its distance from the Sun 100 days later, in the two-body model. (Horizons: n=6.0652706×10−6n = 6.0652706\times10^{-6} °/s, M0=19.356483°M_0 = 19.356483°.)
Show solution

M=M0+n Δt=19.356483°+6.0652706×10−6×8 640 000 °=71.760421°M = M_0 + n\,\Delta t = 19.356483° + 6.0652706\times10^{-6}\times8\,640\,000\ ° = 71.760421°. Newton–Raphson on E−esin⁡E=ME - e\sin E = M with e=0.0933151e = 0.0933151 gives E=76.96931°E = 76.96931°; ν=2arctan⁡ ⁣((1+e)/(1−e)tan⁡(E/2))=82.24148°\nu = 2\arctan\!\big(\sqrt{(1+e)/(1-e)}\tan(E/2)\big) = 82.24148° and r=a(1−ecos⁡E)=2.23143×108r = a(1-e\cos E) = 2.23143\times10^{8} km. (You can check it by asking Horizons for the elements of Mars on 2000-Apr-10 12:00 TDB; the difference, of order 10−510^{-5} in ν\nu, is the perturbation accumulated from the other planets over 100 days.)

  1. (Equinoctial) Express ee, ii, Ω\Omega and ϖ\varpi in terms of (he,ke,pe,qe)(h_e, k_e, p_e, q_e) and show that the map (e,ϖ)↦(he,ke)(e,\varpi)\mapsto(h_e,k_e) is a diffeomorphism of the disk e<1e<1 that includes the origin, whereas (e,ϖ)(e,\varpi) as polar coordinates are not at e=0e = 0.
Show solution

e=he2+ke2e = \sqrt{h_e^2+k_e^2}, ϖ=atan2⁡(he,ke)\varpi = \operatorname{atan2}(h_e,k_e), tan⁡(i/2)=pe2+qe2\tan(i/2) = \sqrt{p_e^2+q_e^2}, Ω=atan2⁡(pe,qe)\Omega = \operatorname{atan2}(p_e,q_e). (he,ke)(h_e,k_e) are the Cartesian coordinates of the polar point (e,ϖ)(e,\varpi); polar coordinates degenerate at the origin (the angle is undefined and the Jacobian ee vanishes), Cartesian ones do not. The same holds for (pe,qe)(p_e,q_e) with tan⁡(i/2)\tan(i/2), which is regular at i=0i = 0 and only diverges at i=πi = \pi.

  1. (Computational) Implement both algorithms (or use src/lib/math/elementos.ts) and: (a) reproduce the table of section 6; (b) check the round trip for 10410^4 random states with e∈[0,0.99]e\in[0,0.99], i∈[0,π]i\in[0,\pi] and measure the maximum error; (c) repeat with e=10−ke = 10^{-k}, k=2,…,12k = 2,\dots,12, and plot the error in ω\omega and in ϖ+ν\varpi + \nu against ee. What logarithmic slope do you expect in each case?
Show solution
import numpy as np
def estado_a_elementos(r, v, mu):
    h = np.cross(r, v); hn = np.linalg.norm(h); n = np.array([-h[1], h[0], 0.0])
    ev = np.cross(v, h)/mu - r/np.linalg.norm(r); e = np.linalg.norm(ev)
    a = -mu/(2*(np.dot(v,v)/2 - mu/np.linalg.norm(r)))
    i = np.arccos(h[2]/hn); Om = np.arctan2(n[1], n[0]) % (2*np.pi)
    w = np.arccos(np.dot(n, ev)/(np.linalg.norm(n)*e)); w = 2*np.pi - w if ev[2] < 0 else w
    nu = np.arccos(np.dot(ev, r)/(e*np.linalg.norm(r))); nu = 2*np.pi - nu if np.dot(r, v) < 0 else nu
    return a, e, i, Om, w, nu

(b) The round-trip error stays at ∼10−15\sim10^{-15} relative except near e=0e = 0 or i=0i = 0. (c) The error in ω\omega grows as ϵmach/e\epsilon_{\text{mach}}/e (slope −1-1 on a log-log scale), whereas that of ϖ+ν\varpi+\nu (the true longitude, which fixes the position) stays at ϵmach\epsilon_{\text{mach}}: the ill-conditioning affects the partition, not the physics.

  1. (Earth satellite) A satellite has, with respect to the ICRF equator, r=(−6045,−3490,2500)\mathbf r = (-6045, -3490, 2500) km and v=(−3.457,6.618,2.533)\mathbf v = (-3.457, 6.618, 2.533) km/s with μ=398 600\mu = 398\,600 km³/s² (Curtis, example 4.3). Compute its elements and state whether the orbit is prograde or retrograde and whether it is above or below the equator at that instant.
Show solution

h=(−25 385,6 670,−52 070)\mathbf h = (-25\,385, 6\,670, -52\,070) km²/s, h=58 310h = 58\,310 km²/s; i=arccos⁡(−52 070/58 310)=153.2°i = \arccos(-52\,070/58\,310) = 153.2° (retrograde, hz<0h_z < 0); n=(−6 670,−25 385,0)\mathbf n = (-6\,670, -25\,385, 0), Ω=255.3°\Omega = 255.3°; e=0.1712e = 0.1712, ω=20.07°\omega = 20.07°, ν=28.45°\nu = 28.45°; a=8 788a = 8\,788 km. Since z=2 500>0z = 2\,500 > 0, it is above the equator, consistent with ω+ν=48.5°∈(0,180°)\omega+\nu = 48.5°\in(0,180°).

Self-assessment

✦ Self-assessment

  1. 1. Of the six Keplerian elements, in the two-body problem the constant ones are…
  2. 2. The inclination is obtained from cos i = h_z/h and needs no quadrant correction because…
  3. 3. The node vector n = ẑ × h…
  4. 4. The matrix Q = R₃(−Ω)R₁(−i)R₃(−ω) transforms…
  5. 5. If an orbit is nearly circular (e ≈ 10⁻⁸), the element that is numerically ill determined is…
  6. 6. The osculating elements of Mars published by Horizons for J2000…
Answer all the questions to check.

Further reading

  • Curtis (2020), ch. 4: the most direct presentation of algorithms 4.2 (state → elements) and 4.5 (elements → state), with numerical examples 4.3 and 4.7 that reproduce our tests.
  • Vallado (2013), §2.4: algorithms 9 and 10 with all the degenerate cases, and §2.4.3 on equinoctial elements and other nonsingular sets.
  • Murray & Dermott (1999), §2.8: the conversion in the context of Solar System dynamics, with the notation (ϖ,λ)(\varpi, \lambda).
  • Broucke & Cefola (1972), DOI 10.1007/BF01228432: the original paper on the equinoctial elements.
  • JPL Horizons, documentation of the ELEMENTS tables (conventions for Ω\Omega, ω\omega, TpT_p and “Keplerian GM”).
🍎 Teacher guide
Time
2 classes of 90 min
Learning outcome
By the end, the student defines the Keplerian elements, constructs the 3-1-3 rotation matrix, implements the conversions in both directions with their degenerate cases and reproduces the osculating elements of a real body from its state vector, explaining the numerical conditioning.
Evidence of learning
Submission of computational problem 6 (code, verification table against Horizons and plot of error versus e) and of problem 4 (propagation) compared with Horizons.

Materials

  • Python 3 with NumPy
  • A physical model of an ellipse and an inclined plane (cardboard) for the angles Ω, i, ω
  • Access to JPL Horizons to download vectors and elements for the same epoch
  • Simulator "Keplerian orbit"

Suggested sequence

Class 1. With the cardboard model, define the six elements and the nodes (20 min). Derive on the board the 3-1-3 sequence and the matrix QQ; check the third column (40 min). Algorithm state → elements step by step with the Mars vector: each group computes one element and the table of section 6 is reconstructed (30 min).

Class 2. Inverse algorithm and propagation with Kepler’s equation; Problem 4 in class (30 min). Conditioning: live numerical experiment with e=10−ke = 10^{-k}, discussion of the equinoctial elements (40 min). Assign problems 6 and 7 (20 min of guided start).

Common mistakes

  • Measuring Ω from the y axis or clockwise; remember that everything is measured in the direction of motion from the equinox.
  • Forgetting the quadrant correction for ω and ν (arccos only gives [0, π]). Always require atan2 or the sign check.
  • Confusing active and passive rotation: using R₃(Ω) instead of R₃(−Ω). The check "third column of Q = h/h" detects the error immediately.
  • Believing that the Horizons elements are "the orbit of Mars", fixed: they are osculating and change with the epoch.
Key terms in this lesson (12)

Glossary terms that appear in the text. Each one links to its full entry.

  • Orbital elements The six numbers that fully describe an orbit: its size, its shape, how it is tilted and oriented, and where the body is at a given moment.
  • Orbital nodes The two points where the Moon's orbit crosses the plane of Earth's orbit. There are eclipses only when the new or full moon happens near a node; that is why there are not eclipses every month.
  • Perihelion The point of the orbit closest to the Sun; there the planet moves fastest. Earth passes through it in early January. For the Moon around Earth it is called perigee.
  • Horizon The line where the sky seems to touch the land or the sea. A celestial object "rises" when it crosses the horizon going up and "sets" when it crosses it going down.
  • Orbit The path one body follows around another because of gravity: the Moon around Earth, Earth around the Sun. Almost all are ellipses, slightly flattened ovals.
  • Equinox The two days of the year (around March 20 and September 22) when day and night last the same everywhere in the world. On those days the Sun rises exactly in the east.
  • Kepler's equation The equation that says where on its ellipse a planet is on a given date. It cannot be solved with algebra: it has to be solved by successive approximations, as astronomy programs do.
  • Latitude How far north or south of the equator a place is, measured in degrees. Bogotá is at about 4.6° north; the North Pole, at 90°.
  • Two-body problem Working out how two bodies move when they attract only each other, like the Sun and a planet. It has an exact solution: Kepler's ellipses. With three bodies there is no longer a closed formula.
  • Euler's method The simplest way to simulate a motion: advance in small time steps assuming the velocity does not change during each step. With small steps it works, but the error builds up.
  • Astronomical unit The average distance between Earth and the Sun. It works as a "ruler" for measuring the Solar System: Jupiter is about 5 au from the Sun.
  • Ecliptic The path the Sun seems to follow among the stars over the course of the year. The planets and the Moon always travel near that line; eclipses happen along it, which is where its name comes from.

See the whole glossary →

References

  • Curtis, H. D. (2020). Orbital Mechanics for Engineering Students, 4th ed. Butterworth-Heinemann, ch. 4 (§4.3–4.7, algorithms 4.2 and 4.5).
  • Vallado, D. A. (2013). Fundamentals of Astrodynamics and Applications, 4th ed. Microcosm Press, §2.4 (algorithms 9 and 10) and §3.7.
  • Murray, C. D. & Dermott, S. F. (1999). Solar System Dynamics. Cambridge University Press, §2.8.
  • Danby, J. M. A. (1988). Fundamentals of Celestial Mechanics, 2nd ed. Willmann-Bell, §6.4–6.5.
  • Broucke, R. A. & Cefola, P. J. (1972). On the equinoctial orbit elements. Celestial Mechanics 5, 303–310. DOI 10.1007/BF01228432
  • Park, R. S. et al. (2021). The JPL Planetary and Lunar Ephemerides DE440 and DE441. The Astronomical Journal 161, 105. DOI 10.3847/1538-3881/abd414
  • JPL Horizons System, Mars and Earth, Sun center (500@10), ecliptic J2000 / ICRF, JD 2451545.0 TDB, VECTORS and ELEMENTS tables; queried 2026-10-29.

Simulators for this lesson: Keplerian orbit