The six classical elements, the quadrant problem, and the two-way conversion with \((\mathbf r,\mathbf v)\)
Figure 1: The orbit is fixed in inertial space by six numbers: two for the conic (\(a,e\)), three for the orientation of its plane (\(i,\Omega,\omega\)), and one for where the body is on it (\(f\)). The dashed curve is the orbit projected onto the reference plane; the green dashed line is the line of nodes. Download the script — run it with no arguments for sliders on all six.
The two-body problem has already given us the conic in its own plane,
\[ r=\frac{p}{1+e\cos f},\qquad p=\frac{h^{2}}{\mu}=a(1-e^{2}), \]
and the perifocal deck has given us \(\mathbf r_{PQW},\mathbf v_{PQW}\) on that conic. What is still missing is the orientation of that plane in inertial space.
Part I counts the constants and fixes the reference frame.
Part II defines \(i,\Omega,\omega\) — and proves that the three vectors \(\mathbf h,\mathbf n,\mathbf e\) are exactly what is needed to measure them.
Part III is the inverse map \((\mathbf r,\mathbf v)\to(a,e,i,\Omega,\omega,f)\), where every angle but \(i\) arrives with the wrong quadrant half the time. This is the part students get wrong, so it gets its own derivation.
Part IV is the forward map \((a,e,i,\Omega,\omega,f)\to(\mathbf r,\mathbf v)\).
Part V works four numerical examples, including a round trip and a deliberate quadrant blunder.
Throughout, \(\mu_\oplus=398600\ \mathrm{km^3/s^2}\) and \(R_\oplus=6378.137\) km. Angles are quoted in degrees, everything is computed in radians.
The two-body equation
\[ \ddot{\mathbf r}=-\frac{\mu}{r^{3}}\mathbf r \]
is a second-order ODE in \(\mathbb R^{3}\), hence a first-order system in \(\mathbb R^{6}\). Its general solution therefore carries six constants of integration, and the state \((\mathbf r,\mathbf v)\) at one instant is one legitimate choice of them.
The classical elements are a different choice, built out of the first integrals already derived:
\[ \mathbf h=\mathbf r\times\mathbf v \quad(3), \qquad \mathbf e=\frac{\mathbf v\times\mathbf h}{\mu}-\hat{\mathbf r} \quad(3), \qquad t_p\quad(1). \]
That is seven numbers, but \(\mathbf h\) and \(\mathbf e\) are not independent:
\[ \mathbf h\cdot\mathbf e=0 , \]
because \(\mathbf e\) lies in the orbital plane. So \(\mathbf h\) and \(\mathbf e\) carry five independent constants, and \(t_p\) is the sixth.
\[ \boxed{\;5\ \text{constants of the }\mathit{orbit}\;+\;1\ \text{constant fixing the }\mathit{clock}\;=\;6 .} \]
The six are grouped by what they control, and the grouping is the whole point:
| element | what it fixes | constant? | |
|---|---|---|---|
| size | \(a\) | the energy, \(\varepsilon=-\mu/2a\) | yes |
| shape | \(e\) | the conic type and flattening | yes |
| \(i\) | tilt of the plane | yes | |
| orientation | \(\Omega\) | swing of the plane about \(\hat{\mathbf K}\) | yes |
| \(\omega\) | turn of the apse line inside the plane | yes | |
| position | \(f\) (or \(M\), or \(t_p\)) | where the body is | no |
Only the last one runs with time. In the Keplerian problem the first five are frozen; under perturbations (\(J_2\), drag, third bodies) they drift slowly, which is precisely why this parameterisation is used for perturbation theory — the fast variable is isolated in one coordinate.
\((a,e)\) and \((i,\Omega,\omega)\) answer two independent questions: what conic? and held how? Changing \(i,\Omega,\omega\) moves the orbit rigidly — it cannot change \(r\), \(v\), \(a\) or \(e\) at a given \(f\). The animation in Part II is exactly this statement.
Angles are meaningless without a frame. The standard inertial (strictly, quasi-inertial) frame for Earth orbits is \(\{\hat{\mathbf I},\hat{\mathbf J},\hat{\mathbf K}\}\):
The \(\hat{\mathbf I}\hat{\mathbf J}\) plane is the reference plane (here, the equator).
The equinox is not fixed: luni-solar precession moves it by about \(50.3''\) per year, and nutation adds a \(9.2''\) wobble. So one must say which equinox — hence J2000 (the mean equator and equinox of 2000 January 1.5 TT) or, for modern work, the ICRF, which is defined by quasar positions and is within \(\sim\!20\) mas of J2000. For a heliocentric orbit, replace “equator” by “ecliptic”; every definition below is unchanged.
Figure 2: Earth’s equatorial plane is tilted by the obliquity \(\varepsilon=23.44^\circ\) from the ecliptic plane of its orbit. Two planes meet in a line, and because the spin axis holds a fixed direction in inertial space while Earth runs round the Sun, that line is fixed too. It cuts the orbit at the two equinoxes — the two days when the Sun lies in Earth’s equatorial plane, so day and night are equal everywhere. \(\hat{\mathbf I}\) is the direction from Earth to the Sun at the March crossing, and \(\hat{\mathbf K}\) is the spin axis, so the frame is built entirely from these two planes. Nothing is to scale: Earth is drawn some \(10^{4}\) times too large, and the orbit is drawn circular (\(e_\oplus=0.0167\)). Download the script.
This also says why the equinox moves. The line is the intersection of two planes, so anything that tips either plane drags it: luni-solar torque on Earth’s equatorial bulge swings the spin axis round a \(26\,000\)-year cone, carrying \(\hat{\mathbf I}\) westward along the ecliptic at \(50.3''\) per year. Hence J2000, and hence the rule that a state vector without an epoch is not a state vector.
Everything follows from three vectors built from the state:
\[ \begin{align} \mathbf h &= \mathbf r\times\mathbf v && \text{normal to the orbital plane},\\[2pt] \mathbf n &= \hat{\mathbf K}\times\mathbf h && \text{the }\mathbf{node\ line},\\[2pt] \mathbf e &= \frac{\mathbf v\times\mathbf h}{\mu}-\hat{\mathbf r} && \text{towards periapsis}. \end{align} \]
They are mutually consistent: \(\mathbf h\cdot\mathbf e=0\), \(\mathbf n\cdot\mathbf h=0\), \(\mathbf n\cdot\hat{\mathbf K}=0\).
The node line is a line; the ascending node is a direction on it — the crossing where the body moves from south to north (\(\dot z>0\)). We must check \(\mathbf n=\hat{\mathbf K}\times\mathbf h\) picks that end.
At a node, \(\mathbf r\) lies in the equatorial plane, so \(z=0\). Then
\[ \mathbf r\cdot\mathbf n =\mathbf r\cdot(\hat{\mathbf K}\times\mathbf h) =\hat{\mathbf K}\cdot(\mathbf h\times\mathbf r), \]
and, using \(\mathbf h=\mathbf r\times\mathbf v\) with the BAC–CAB rule,
\[ \mathbf h\times\mathbf r =(\mathbf r\times\mathbf v)\times\mathbf r =r^{2}\mathbf v-(\mathbf r\cdot\mathbf v)\,\mathbf r . \]
Taking the \(\hat{\mathbf K}\) component and setting \(z=0\),
\[ \mathbf r\cdot\mathbf n = r^{2}\dot z-(\mathbf r\cdot\mathbf v)\,z = r^{2}\dot z . \]
\[ \boxed{\ \mathbf r\cdot\mathbf n>0 \iff \dot z>0\ } \]
so \(\mathbf n\) points at the node where the body is climbing: the ascending node. \(\blacksquare\)
Inclination \(i\in[0^\circ,180^\circ]\) — the angle between \(\hat{\mathbf K}\) and \(\mathbf h\); equivalently, the dihedral angle between the equatorial and orbital planes, measured about the node line.
Right ascension of the ascending node \(\Omega\in[0^\circ,360^\circ)\) — the angle from \(\hat{\mathbf I}\) to \(\mathbf n\), measured in the equatorial plane, counterclockwise about \(\hat{\mathbf K}\).
Argument of periapsis \(\omega\in[0^\circ,360^\circ)\) — the angle from \(\mathbf n\) to \(\mathbf e\), measured in the orbital plane, in the direction of motion (i.e. counterclockwise about \(\hat{\mathbf h}\)).
And, for completeness, the one that moves:
True anomaly \(f\in[0^\circ,360^\circ)\) — the angle from \(\mathbf e\) to \(\mathbf r\), in the orbital plane, about \(\hat{\mathbf h}\).
Note the three different planes/axes of measurement: \(\Omega\) about \(\hat{\mathbf K}\), \(i\) about \(\hat{\mathbf n}\), and \(\omega, f\) about \(\hat{\mathbf h}\). This is the classical 3–1–3 Euler sequence, and it is why the rotation matrix of Part IV is \(\mathbf R_3(\Omega)\mathbf R_1(i)\mathbf R_3(\omega)\).
Figure 3: Each leg of the tour varies one orientation angle and holds the other two: \(\Omega\) swings the line of nodes in the reference plane, \(i\) tilts the plane about that line, \(\omega\) turns the apse line inside the plane. The conic never changes size or shape — only the frame it is held in.
| \(i\) | name | remark |
|---|---|---|
| \(0^\circ\) | equatorial prograde | node line undefined |
| \(0^\circ<i<90^\circ\) | prograde (direct) | \(h_z>0\), moves east |
| \(90^\circ\) | polar | passes over both poles |
| \(90^\circ<i<180^\circ\) | retrograde | \(h_z<0\), moves west |
| \(180^\circ\) | equatorial retrograde | node line undefined |
Two named cases live in this table. A sun-synchronous orbit uses the \(J_2\)-driven drift \(\dot\Omega\propto\cos i\) to make \(\dot\Omega=+0.9856^\circ\)/day, which needs \(\cos i<0\), i.e. a retrograde orbit (\(i\approx98^\circ\) at LEO). A Molniya orbit sits at the critical inclination \(i=63.4^\circ\), where \(\dot\omega\propto(5\cos^{2}i-1)\) vanishes and the apogee stays parked over the northern hemisphere.
Two of the three orientation angles are defined by directions that can cease to exist.
Circular orbit, \(e=0\). Then \(\mathbf e=\mathbf 0\): there is no periapsis, so \(\omega\) and \(f\) are both undefined — but their sum is not. Use the argument of latitude \[u=\omega+f,\qquad \cos u=\frac{\mathbf n\cdot\mathbf r}{n\,r},\qquad u>180^\circ \text{ if } z<0 .\]
Equatorial orbit, \(i=0^\circ\) or \(180^\circ\). Then \(\mathbf n=\mathbf 0\): there is no node, so \(\Omega\) and \(\omega\) are both undefined — but their sum is not. Use the longitude of periapsis \[\varpi=\Omega+\omega,\qquad \cos\varpi=\frac{e_I}{e},\qquad \varpi>180^\circ \text{ if } e_J<0 .\]
Circular and equatorial: use the true longitude \(\lambda=\Omega+\omega+f\), with \(\cos\lambda=r_I/r\) and \(\lambda>180^\circ\) if \(r_J<0\).
\(u\), \(\varpi\) and \(\lambda\) are dogleg angles: their two pieces are measured in different planes. This is legitimate only because the angle between those planes (\(i\), or the arc from \(\mathbf n\) to \(\mathbf e\)) is the very thing that has degenerated to zero. Numerically the trouble arrives before the exact degeneracy: for small \(e\) the direction of \(\mathbf e\) is ill-conditioned, and for small \(i\) the direction of \(\mathbf n\) is. The cure is either a tolerance test (\(e<10^{-8}\), \(\sin i<10^{-8}\)) or a non-singular set — the equinoctial elements \((a,\;e\cos\varpi,\;e\sin\varpi,\;\tan\frac i2\cos\Omega,\;\tan\frac i2\sin\Omega,\;\lambda)\), which have no degeneracies except the retrograde \(i=180^\circ\).
Given \(\mathbf r,\mathbf v\) in \(\{\hat{\mathbf I},\hat{\mathbf J},\hat{\mathbf K}\}\) and \(\mu\):
| # | quantity | formula | quadrant |
|---|---|---|---|
| 1 | radius, speed | \(r=\lvert\mathbf r\rvert\), \(v=\lvert\mathbf v\rvert\) | — |
| 2 | radial speed | \(v_r=\dfrac{\mathbf r\cdot\mathbf v}{r}\) | sign matters (step 9) |
| 3 | ang. momentum | \(\mathbf h=\mathbf r\times\mathbf v\), \(h=\lvert\mathbf h\rvert\) | — |
| 4 | inclination | \(i=\arccos\dfrac{h_K}{h}\) | none needed |
| 5 | node vector | \(\mathbf n=\hat{\mathbf K}\times\mathbf h=(-h_J,\,h_I,\,0)\), \(n=\lvert\mathbf n\rvert\) | — |
| 6 | RAAN | \(\Omega=\arccos\dfrac{n_I}{n}\) | \(n_J<0\Rightarrow\Omega\mapsto360^\circ-\Omega\) |
| 7 | ecc. vector | \(\mathbf e=\dfrac1\mu\!\left[\left(v^{2}-\dfrac\mu r\right)\mathbf r-(\mathbf r\cdot\mathbf v)\mathbf v\right]\), \(e=\lvert\mathbf e\rvert\) | — |
| 8 | arg. periapsis | \(\omega=\arccos\dfrac{\mathbf n\cdot\mathbf e}{n\,e}\) | \(e_K<0\Rightarrow\omega\mapsto360^\circ-\omega\) |
| 9 | true anomaly | \(f=\arccos\dfrac{\mathbf e\cdot\mathbf r}{e\,r}\) | \(v_r<0\Rightarrow f\mapsto360^\circ-f\) |
| 10 | size | \(a=\left(\dfrac2r-\dfrac{v^{2}}\mu\right)^{-1}\), \(p=\dfrac{h^{2}}\mu\) | — |
Steps 4, 6, 8, 9 are the four angles. Three of the four carry a quadrant test. The next three slides say where those tests come from, and why \(i\) escapes.
Every one of the four angles is extracted from a dot product, i.e. from its cosine. But
\[ \cos\theta=\cos(2\pi-\theta), \]
so \(\arccos\) — whose range is \([0,\pi]\) by definition — cannot tell \(\theta\) from \(2\pi-\theta\). It always returns the one in the upper half plane.
\[ \boxed{\ \text{A cosine fixes an angle only up to reflection about the } 0\!-\!\pi \text{ axis.}\ } \]
To resolve it we need one extra bit of information: the sign of the sine. For an angle measured from \(\mathbf a\) to \(\mathbf b\) about a unit axis \(\hat{\mathbf k}\) (with \(\mathbf a,\mathbf b\perp\hat{\mathbf k}\)),
\[ \cos\theta=\frac{\mathbf a\cdot\mathbf b}{ab}, \qquad \sin\theta=\frac{(\mathbf a\times\mathbf b)\cdot\hat{\mathbf k}}{ab} . \]
So the recipe for each angle is the same: compute the triple product, keep its sign. What follows shows that in each case that triple product collapses to a single component we already have.
\(i\) is the odd one out, and for a definitional reason, not an algebraic one.
The inclination is defined on \([0^\circ,180^\circ]\) — one takes the angle between two planes to be the non-reflex one. On that interval
\[ \sin i\ \ge\ 0 \]
identically, so the sign of the sine carries no information and \(\arccos\) is already single-valued. There is nothing to disambiguate.
The price of that convention is paid elsewhere: because \(i\) cannot exceed \(180^\circ\), the distinction between “east-going” and “west-going” has to be carried by \(i\) itself (\(h_K\gtrless0\)), and \(\Omega\) must be free to run over the full \([0^\circ,360^\circ)\).
\(n=|\hat{\mathbf K}\times\mathbf h| = h\sin i\ \ge 0\) likewise, which is the reason \(n\) appears as a positive normaliser in steps 6 and 8 and never flips a sign.
\(\mathbf n\) lies in the equatorial plane by construction, so it has the form
\[ \mathbf n=n\,(\cos\Omega,\ \sin\Omega,\ 0), \]
directly from the definition of \(\Omega\) as the angle from \(\hat{\mathbf I}\) in that plane. Hence
\[ \cos\Omega=\frac{n_I}{n}, \qquad \sin\Omega=\frac{n_J}{n}, \]
and since \(n>0\),
\[ \boxed{\ \operatorname{sign}(\sin\Omega)=\operatorname{sign}(n_J) \quad\Longrightarrow\quad \Omega=\operatorname{atan2}(n_J,\;n_I).\ } \]
With \(\mathbf n=\hat{\mathbf K}\times\mathbf h=(-h_J,h_I,0)\) this is \(\Omega=\operatorname{atan2}(h_I,-h_J)\) — no intermediate vector needed at all.
\(\omega\) is measured from \(\mathbf n\) to \(\mathbf e\) about \(\hat{\mathbf h}\), so
\[ \sin\omega=\frac{(\mathbf n\times\mathbf e)\cdot\hat{\mathbf h}}{n\,e} . \]
Evaluate the numerator. With \(\mathbf n=\hat{\mathbf K}\times\mathbf h\) and the BAC–CAB rule \((\mathbf A\times\mathbf B)\times\mathbf C=\mathbf B(\mathbf A\cdot\mathbf C)-\mathbf A(\mathbf B\cdot\mathbf C)\),
\[ \mathbf n\times\mathbf e =(\hat{\mathbf K}\times\mathbf h)\times\mathbf e =\mathbf h\,(\hat{\mathbf K}\cdot\mathbf e)-\hat{\mathbf K}\,(\mathbf h\cdot\mathbf e) =e_K\,\mathbf h , \]
because \(\mathbf h\cdot\mathbf e=0\). Dotting with \(\hat{\mathbf h}=\mathbf h/h\),
\[ (\mathbf n\times\mathbf e)\cdot\hat{\mathbf h}=e_K\,h \qquad\Longrightarrow\qquad \sin\omega=\frac{h\,e_K}{n\,e}=\frac{e_K}{e\sin i}, \]
using \(n=h\sin i\). Since \(e\sin i>0\) whenever \(\omega\) is defined at all,
\[ \boxed{\ \operatorname{sign}(\sin\omega)=\operatorname{sign}(e_K) \quad\Longrightarrow\quad \omega=\operatorname{atan2}\!\left(\frac{e_K}{\sin i},\ \frac{\mathbf n\cdot\mathbf e}{n}\right).\ } \]
In words: \(\omega<180^\circ\) exactly when periapsis lies above the equator. \(\blacksquare\)
\(f\) is measured from \(\mathbf e\) to \(\mathbf r\) about \(\hat{\mathbf h}\), so
\[ \sin f=\frac{(\mathbf e\times\mathbf r)\cdot\hat{\mathbf h}}{e\,r} . \]
Using \(\mathbf e=\dfrac{\mathbf v\times\mathbf h}{\mu}-\dfrac{\mathbf r}{r}\), the second term contributes nothing to \(\mathbf e\times\mathbf r\), so
\[ \mathbf e\times\mathbf r =\frac{(\mathbf v\times\mathbf h)\times\mathbf r}{\mu} =\frac{\mathbf h(\mathbf v\cdot\mathbf r)-\mathbf v(\mathbf h\cdot\mathbf r)}{\mu} =\frac{(\mathbf r\cdot\mathbf v)}{\mu}\,\mathbf h , \]
since \(\mathbf h\cdot\mathbf r=0\). Therefore
\[ \sin f=\frac{h\,(\mathbf r\cdot\mathbf v)}{\mu\,e\,r}=\frac{h\,v_r}{\mu\,e}, \]
and as \(h,\mu,e,r>0\),
\[ \boxed{\ \operatorname{sign}(\sin f)=\operatorname{sign}(v_r) \quad\Longrightarrow\quad f=\operatorname{atan2}\!\left(\frac{h\,v_r}{\mu},\ \frac{\mathbf e\cdot\mathbf r}{e}\right).\ } \]
In words: \(f<180^\circ\) exactly when the body is outbound — climbing from periapsis towards apoapsis. This is just the statement that \(r\) increases on the first half of the orbit, which is where the \(e\sin f\) in \(\dot r=(\mu/h)e\sin f\) came from. \(\blacksquare\)
\[ \Omega:\ \operatorname{sign}(n_J) \qquad \omega:\ \operatorname{sign}(e_K) \qquad f:\ \operatorname{sign}(\mathbf r\cdot\mathbf v) \]
Each of them is one number you already have. Each of them is geometric:
| angle | flip when | meaning |
|---|---|---|
| \(\Omega\) | \(n_J<0\) | ascending node in the \(\hat{\mathbf J}<0\) half of the equator |
| \(\omega\) | \(e_K<0\) | periapsis below the equatorial plane |
| \(f\) | \(\mathbf r\cdot\mathbf v<0\) | body inbound, falling towards periapsis |
Prefer the \(\operatorname{atan2}\) forms in code. \(\arccos\) is not merely quadrant-blind, it is also ill-conditioned near \(0\) and \(\pi\): from \(\delta\theta=\delta(\cos\theta)/\sin\theta\), an error \(\epsilon\) in the cosine becomes \(\sqrt{2\epsilon}\) in the angle as \(\theta\to0\). At \(\epsilon=10^{-16}\) that is \(\sim\!10^{-8}\) rad — half the significant digits gone. \(\operatorname{atan2}\) suffers no such loss, and it also handles \(\cos\theta\) drifting outside \([-1,1]\) by rounding, which makes bare \(\arccos\) return NaN.
The scalars come out of the invariants directly:
\[ \varepsilon=\frac{v^{2}}{2}-\frac{\mu}{r} \ \Longrightarrow\ a=-\frac{\mu}{2\varepsilon}=\left(\frac2r-\frac{v^{2}}{\mu}\right)^{-1}, \qquad p=\frac{h^{2}}{\mu}, \qquad e=\sqrt{1-\frac pa}, \]
with the apsides and period (elliptic case)
\[ r_p=a(1-e)=\frac{p}{1+e}, \qquad r_a=a(1+e), \qquad T=2\pi\sqrt{\frac{a^{3}}{\mu}} . \]
Some texts carry \(h\) rather than \(a\) as the size element, i.e. \((h,e,i,\Omega,\omega,f)\) — Curtis does. It is the better choice for the parabola, where \(a\to\infty\) and \(\varepsilon\to0\), while \(h\) and \(p=h^2/\mu\) stay finite. For a hyperbola both work, with \(a<0\) and \(p=a(1-e^{2})>0\).
Step 1 — the conic in its own plane. From the perifocal deck,
\[ \mathbf r_{PQW} =\frac{p}{1+e\cos f} \begin{bmatrix}\cos f\\ \sin f\\ 0\end{bmatrix}, \qquad \mathbf v_{PQW} =\sqrt{\frac{\mu}{p}} \begin{bmatrix}-\sin f\\ e+\cos f\\ 0\end{bmatrix} =\frac{\mu}{h} \begin{bmatrix}-\sin f\\ e+\cos f\\ 0\end{bmatrix}. \]
Step 2 — rotate into the inertial frame. Undo the 3–1–3 sequence in reverse order:
\[ \mathbf Q_{PQW\to IJK}=\mathbf R_3(\Omega)\,\mathbf R_1(i)\,\mathbf R_3(\omega), \qquad \mathbf r_{IJK}=\mathbf Q\,\mathbf r_{PQW}, \quad \mathbf v_{IJK}=\mathbf Q\,\mathbf v_{PQW} . \]
Read the sequence right to left, as the rotations are applied: first \(\omega\) turns \(\hat{\mathbf p}\) back onto the node line, then \(i\) lays the orbital plane down onto the equator, then \(\Omega\) swings the node line round onto \(\hat{\mathbf I}\).
The forward map has no quadrant problem at all. \((a,e,i,\Omega,\omega,f)\mapsto(\mathbf r,\mathbf v)\) is a single-valued function: sines and cosines of known angles, no inverse trigonometry anywhere. All the difficulty of Part III came from inverting it.
\[ \mathbf Q_{PQW\to IJK}= \begin{bmatrix} c_\Omega c_\omega-s_\Omega s_\omega c_i & -c_\Omega s_\omega-s_\Omega c_\omega c_i & s_\Omega s_i\\[2pt] s_\Omega c_\omega+c_\Omega s_\omega c_i & -s_\Omega s_\omega+c_\Omega c_\omega c_i & -c_\Omega s_i\\[2pt] s_\omega s_i & c_\omega s_i & c_i \end{bmatrix}, \qquad \begin{aligned} c_\theta&\equiv\cos\theta,\\ s_\theta&\equiv\sin\theta . \end{aligned} \]
Three checks worth doing once, by hand:
Convention trap
This \(\mathbf Q\) rotates vectors (active rotation), and maps perifocal components to inertial ones. Many texts — Vallado and Curtis among them — tabulate the transpose, because they define \(\mathbf R_3\) as rotating the frame. The two differ by \(\Omega\to-\Omega\), \(i\to-i\), \(\omega\to-\omega\). Always check one column against a case you know, e.g. \(i=\Omega=\omega=0\Rightarrow\mathbf Q=\mathbf 1\).
\[ \underbrace{(\mathbf r,\mathbf v) \xrightarrow[\ \text{3 quadrant tests}\ ]{\ \mathbf h,\ \mathbf n,\ \mathbf e\ } (a,e,i,\Omega,\omega,f)}_{\mathbf{Part\ III}\text{: inverse, delicate}} \]
\[ \underbrace{(a,e,i,\Omega,\omega,f) \xrightarrow[\ \text{no inverse trig}\ ]{\ \mathbf r_{PQW},\mathbf v_{PQW};\ \mathbf R_3\mathbf R_1\mathbf R_3\ } (\mathbf r,\mathbf v)}_{\mathbf{Part\ IV}\text{: forward, trivial}} \]
Together with Kepler’s equation these close the propagation loop:
\[ \boxed{\ (\mathbf r,\mathbf v)_{t_0} \to (a,e,i,\Omega,\omega,f_0) \to M_0 \to M(t) \to E \to f \to (\mathbf r,\mathbf v)_{t}\ } \]
where only \(f\) changed. Five elements are the orbit; the sixth is the clock.
Given (\(\mu=398600\ \mathrm{km^3/s^2}\))
\[ \mathbf r=(-6045,\ -3490,\ 2500)\ \mathrm{km}, \qquad \mathbf v=(-3.457,\ 6.618,\ 2.533)\ \mathrm{km/s}. \]
Steps 1–3.
\[ r=7414.319\ \mathrm{km},\qquad v=7.884470\ \mathrm{km/s},\qquad v_r=\frac{\mathbf r\cdot\mathbf v}{r}=\frac{4133.245}{7414.319}=+0.557468\ \mathrm{km/s} . \]
\[ \mathbf h=\mathbf r\times\mathbf v=(-25385.17,\ 6669.485,\ -52070.74)\ \mathrm{km^2/s}, \qquad h=58311.67\ \mathrm{km^2/s}. \]
Step 4 — inclination.
\[ i=\arccos\frac{h_K}{h}=\arccos\frac{-52070.74}{58311.67}=\arccos(-0.892973)=\boxed{153.249^\circ} \]
Greater than \(90^\circ\): the orbit is retrograde. No quadrant test — \(i\) never needs one.
Step 5.
\[ \mathbf n=\hat{\mathbf K}\times\mathbf h=(-h_J,\ h_I,\ 0)=(-6669.485,\ -25385.17,\ 0), \qquad n=26246.69 . \]
Step 6.
\[ \cos\Omega=\frac{n_I}{n}=\frac{-6669.485}{26246.69}=-0.254108 \qquad\Longrightarrow\qquad \arccos(-0.254108)=104.721^\circ . \]
Now the test: \(n_J=-25385.17<0\), so the ascending node is in the \(\hat{\mathbf J}<0\) half of the equatorial plane and
\[ \Omega=360^\circ-104.721^\circ=\boxed{255.279^\circ} \]
Check with \(\operatorname{atan2}\): \(\operatorname{atan2}(-25385.17,\,-6669.485)=-104.721^\circ\), which modulo \(360^\circ\) is \(255.279^\circ\). Same answer, no case analysis.
Step 7. With \(v^{2}-\mu/r=62.16486-53.76084=8.40402\ \mathrm{km^2/s^2}\) and \(\mathbf r\cdot\mathbf v=4133.245\ \mathrm{km^2/s}\),
\[ \mathbf e=\frac1\mu\left[8.40402\,\mathbf r-4133.245\,\mathbf v\right] =(-0.091605,\ -0.142207,\ +0.026444), \qquad e=\boxed{0.171212} \]
Step 8.
\[ \cos\omega=\frac{\mathbf n\cdot\mathbf e}{n\,e}=\frac{4220.92}{26246.69\times0.171212}=0.939284 \quad\Longrightarrow\quad \arccos(0.939284)=20.068^\circ . \]
Test: \(e_K=+0.026444>0\), so periapsis lies above the equator and the first-quadrant answer stands:
\[ \omega=\boxed{20.068^\circ} \]
Step 9.
\[ \cos f=\frac{\mathbf e\cdot\mathbf r}{e\,r}=\frac{1116.16}{0.171212\times7414.319}=0.879270 \quad\Longrightarrow\quad \arccos(0.879270)=28.446^\circ , \]
and \(v_r=+0.557>0\) says the body is outbound, so \(f=\boxed{28.446^\circ}\) stands too.
Step 10.
\[ \varepsilon=\frac{v^{2}}{2}-\frac{\mu}{r}=31.08243-53.76084=-22.67841\ \mathrm{km^2/s^2} \ \Longrightarrow\ a=-\frac{398600}{2(-22.67841)}=8788.10\ \mathrm{km}. \]
\[ \boxed{\ a=8788.10\ \mathrm{km},\quad e=0.171212,\quad i=153.249^\circ,\quad \Omega=255.279^\circ,\quad \omega=20.068^\circ,\quad f=28.446^\circ\ } \]
Sanity check on the geometry:
\[ r_p=a(1-e)=7283.46\ \mathrm{km}\ (905.3\ \mathrm{km\ altitude}), \quad r_a=a(1+e)=10292.73\ \mathrm{km}, \]
\[ p=\frac{h^{2}}{\mu}=8530.48\ \mathrm{km}, \qquad T=2\pi\sqrt{\frac{a^{3}}{\mu}}=8198.9\ \mathrm{s}=2.2775\ \mathrm{h}. \]
Perigee is above the atmosphere and \(r_p<r<r_a\) holds, as it must.
Take the six numbers just found and run Part IV. With \(p=h^{2}/\mu=8530.48\) km and \(f=28.446^\circ\),
\[ \mathbf r_{PQW}=\frac{8530.48}{1+0.171212\cos f}\begin{bmatrix}\cos f\\ \sin f\\ 0\end{bmatrix} =\begin{bmatrix}6519.19\\ 3531.62\\ 0\end{bmatrix}\ \mathrm{km}, \qquad \mathbf v_{PQW}=\frac{398600}{58311.67}\begin{bmatrix}-\sin f\\ e+\cos f\\ 0\end{bmatrix} =\begin{bmatrix}-3.25600\\ 7.18076\\ 0\end{bmatrix}\ \mathrm{km/s}. \]
Note \(|\mathbf r_{PQW}|=7414.32\) km and \(|\mathbf v_{PQW}|=7.88447\) km/s — the scalars from Example 1, as they must be: a rotation cannot change a length.
With \(c_\Omega=-0.254107\), \(s_\Omega=-0.967176\), \(c_i=-0.892973\), \(s_i=0.450111\), \(c_\omega=0.939284\), \(s_\omega=0.343140\),
\[ \mathbf Q=\begin{bmatrix} -0.535036 & -0.724029 & -0.435336\\ -0.830591 & \ \ 0.545011 & \ \ 0.114377\\ \ \ 0.154451 & \ \ 0.422782 & -0.892973 \end{bmatrix}. \]
\[ \mathbf r_{IJK}=\mathbf Q\,\mathbf r_{PQW}=(-6045.00,\ -3490.01,\ 2500.00)\ \mathrm{km}, \] \[ \mathbf v_{IJK}=\mathbf Q\,\mathbf v_{PQW}=(-3.45700,\ 6.61800,\ 2.53300)\ \mathrm{km/s}. \]
Against the original state,
\[ |\Delta\mathbf r|=8.4\ \mathrm{m}, \qquad |\Delta\mathbf v|=7\times10^{-6}\ \mathrm{km/s}, \]
which is entirely the six-figure rounding of the elements, not the algorithm: carried in double precision the residual is \(2\times10^{-12}\) km. Run python codes/orbital-elements-3d.py --verify to see the round trip and the shape-invariance check over a spread of random cases.
A round trip is the only cheap test that exercises all three quadrant rules at once. If any one of them is wrong, \(\mathbf r\) comes back somewhere else entirely — as the next slide shows.
Suppose in Example 1 we had trusted \(\arccos\) and written \(\Omega=104.721^\circ\) instead of \(255.279^\circ\), keeping everything else right. The forward map then gives
\[ \mathbf r=(3548.89,\ 6010.62,\ 2500.00)\ \mathrm{km} \qquad\text{instead of}\qquad (-6045,\ -3490,\ 2500)\ \mathrm{km}. \]
\[ \boxed{\ |\Delta\mathbf r|=13502\ \mathrm{km}\ } \]
— nearly twice the orbital radius, and on the other side of the Earth. Note what did not change: \(|\mathbf r|=7414.32\) km, \(a\), \(e\), \(i\) and \(f\) are all still exactly right.
This is the characteristic signature of a quadrant blunder: every scalar checks out and the vector is nonsense. A magnitude check can never catch it, because reflecting \(\Omega\mapsto-\Omega\) is a rotation of the whole orbit — it preserves every length and every angle within the orbit. Only a component-wise comparison catches it.
Given
\[ \mathbf r=(-1222.492,\ 9623.627,\ 6500.568)\ \mathrm{km}, \qquad \mathbf v=(-3.297635,\ 0.034197,\ -4.916837)\ \mathrm{km/s}. \]
\[ r=11677.59\ \mathrm{km},\quad v=5.920376\ \mathrm{km/s},\quad \mathbf r\cdot\mathbf v=-27601.8\ \Rightarrow\ v_r=-2.363656\ \mathrm{km/s}\ (\mathbf{inbound}), \]
\[ \mathbf h=(-47540.11,\ -27447.29,\ 31693.40),\quad h=63386.81,\quad i=\arccos\frac{31693.40}{63386.81}=\arccos(0.5)=\boxed{60.000^\circ} \]
\[ \mathbf n=(27447.29,\ -47540.11,\ 0),\quad n=54894.59, \qquad \mathbf e=(-0.231164,\ 0.024510,\ -0.325519),\quad e=0.400000 . \]
| angle | \(\cos\) | \(\arccos\) | test | value | corrected |
|---|---|---|---|---|---|
| \(\Omega\) | \(+0.500000\) | \(60.000^\circ\) | \(n_J\) | \(-47540<0\) | \(\mathbf{300.000^\circ}\) |
| \(\omega\) | \(-0.342020\) | \(110.000^\circ\) | \(e_K\) | \(-0.3255<0\) | \(\mathbf{250.000^\circ}\) |
| \(f\) | \(-0.342020\) | \(110.000^\circ\) | \(\mathbf r\cdot\mathbf v\) | \(-27602<0\) | \(\mathbf{250.000^\circ}\) |
Every one of the three raw \(\arccos\) answers is wrong. With \(a=(2/r-v^{2}/\mu)^{-1}=12000.0\) km,
\[ \boxed{\ a=12000\ \mathrm{km},\quad e=0.4,\quad i=60^\circ,\quad \Omega=300^\circ,\quad \omega=250^\circ,\quad f=250^\circ\ } \]
\[ r_p=7200\ \mathrm{km},\qquad r_a=16800\ \mathrm{km},\qquad T=13082.3\ \mathrm{s}=3.634\ \mathrm{h}. \]
The body is inbound at \(f=250^\circ\). How long until perigee?
Use the quadrant-safe form \(E=2\operatorname{atan2}\!\left(\sqrt{1-e}\,\sin\tfrac f2,\ \sqrt{1+e}\,\cos\tfrac f2\right)=273.851^\circ\) (note \(\arctan\) of the half-angle ratio alone would have returned \(-86.15^\circ\) — the same quadrant trap, one level down). Then \(\sin E=-0.997742\) and
\[ M=E-e\sin E=273.851^\circ-0.4(-0.997742)\ \mathrm{rad}=273.851^\circ+22.867^\circ=296.718^\circ . \]
Perigee is at \(M=360^\circ\), so
\[ \Delta t=\frac{360-296.718}{360}\,T=0.17578\times13082.3=2299.6\ \mathrm{s}=38.3\ \mathrm{min}. \]
The forward map never asks what conic it is drawing. Given
\[ h=80000\ \mathrm{km^2/s},\quad e=1.4,\quad i=30^\circ,\quad \Omega=40^\circ,\quad \omega=60^\circ,\quad f=30^\circ . \]
\[ p=\frac{h^{2}}{\mu}=16056.20\ \mathrm{km}, \qquad a=\frac{p}{1-e^{2}}=-16725.20\ \mathrm{km}\ \ (<0,\ \text{as it must be}), \]
\[ \mathbf r_{PQW}=(6284.96,\ 3628.62,\ 0), \qquad \mathbf v_{PQW}=(-2.49125,\ 11.29047,\ 0). \]
\[ \boxed{\ \mathbf r=(-4039.90,\ 4814.56,\ 3628.62)\ \mathrm{km}, \qquad \mathbf v=(-10.3860,\ -4.7719,\ 1.7439)\ \mathrm{km/s}\ } \]
Check: \(r=7257.25\) km, \(v=11.5621\) km/s, and
\[ \varepsilon=\frac{v^{2}}2-\frac\mu r=+11.917\ \mathrm{km^2/s^2}>0, \qquad v_\infty=\sqrt{2\varepsilon}=4.882\ \mathrm{km/s}. \]
Positive energy, as \(e>1\) demands. Nothing in Part IV was modified.
if. Same answer, better conditioning, no NaN from \(|\cos\theta|>1\) by rounding.The elements are the natural language for everything that follows:
Two-line element sets (TLEs) quote \(i\), \(\Omega\), \(e\), \(\omega\), \(M\) and the mean motion \(n\) (from which \(a\) follows) — the same six, in the same order as the algorithm produces them. They are, however, mean elements tied to the SGP4 propagator, not the osculating elements of this deck; feeding them to a Keplerian propagator is a common and expensive mistake.

SFM, IIST 2026