3.4.2 · D3Rocket Flight Mechanics

Worked examples — Transformation between frames — direction cosine matrices

2,886 words13 min readBack to topic

Before any example, we must pin down what "" even means — otherwise every sign below floats free.

The intro figure below draws the axis-3 case so you can see it.

Figure — Transformation between frames — direction cosine matrices

Reading the figure (memorise this — every example leans on it). The blue pair are the original axes: points right, points up. The green pair are the new axes after a positive yaw about axis 3: they are the blue axes rotated counter-clockwise by (the yellow arc marks , sweeping , exactly the right-hand rule for axis 3). The white arrow is the physical vector — it never moves. Because the axes spun but the vector stayed put, the vector's coordinates in the green frame change as if the vector had spun . That single asymmetry is the source of every minus sign you are about to meet.


The scenario matrix

Every problem this topic can ask lands in one of these cells. The examples that follow are each tagged with the cell they cover.

Cell What makes it tricky Covered by
C1 Single rotation, angle in quadrant I () baseline, both sin & cos positive Ex 1
C2 Single rotation, angle in quadrants II–IV (sign flips) change sign — must not assume positive Ex 2 (all three quadrants)
C3 Zero / degenerate input ( or vector is ) matrix becomes identity; must recognise "nothing happens" Ex 3
C4 Limiting value () components swap or negate cleanly — a sanity anchor Ex 4
C5 Which-axis minus-sign trap ( vs ) the lone matrix with on the upper off-diagonal Ex 5
C6 Chained rotations + direction ( vs ) order matters, and inner index must match the data Ex 6
C7 Real-world word problem (thrust vectoring) translate physics → frames → numbers Ex 7
C8 Exam twist: recover the angle from a given matrix run the machine backwards using Ex 8

Example 1 — baseline single yaw (Cell C1)

Forecast: the length is . Guess: will still have length ? Which component grows, which shrinks?

  1. Write the yaw matrix. Why this step? A yaw is a rotation about axis 3, so we use exactly as derived from :

  2. Apply it to the data. Why this step? Our data lives in , and eats an -vector — the inner index matches, so we may multiply directly:

  3. Read the result. All angles here are in quadrant I so both and are positive — no sign surprises. Tie this back to the intro figure: the axes swung , so relative to them the vector leans slightly less into the second axis — that's why .

Verify: length m/s ✓ (orthogonality preserves magnitude). Units: m/s in, m/s out ✓.


Example 2 — angles in quadrants II, III, IV (Cell C2)

Forecast: each quadrant gives a different . Fill this in before computing: QII , QIII , QIV . The first output component is , the second is .

  1. Quadrant II, . Why this step? Here (negative) but (positive) — a mixed-sign case you must not shortcut:
\mathbf v^B=\begin{pmatrix}-8.66\\ -5.0\\0\end{pmatrix}\text{ m/s}.$$ The second component is $-10\sin150°=-5$: negative even though $\sin$ was positive, because of the formula's leading minus. 2. **Quadrant III, $\psi=210°$.** *Why this step?* Now **both** are negative, $\cos210°=-0.866,\ \sin210°=-0.5$: $$\mathbf C_3(210°)=\begin{pmatrix}-0.866 & -0.5 & 0\\ 0.5 & -0.866 & 0\\ 0&0&1\end{pmatrix},\qquad \mathbf v^B=\begin{pmatrix}-8.66\\ 5.0\\0\end{pmatrix}\text{ m/s}.$$ Here the second component flips *positive* ($-10\sin210°=+5$) — the opposite of case (a), proving the sign truly depends on the quadrant. 3. **Quadrant IV, $\psi=300°$.** *Why this step?* Now $\cos300°=+0.5$ (positive) and $\sin300°=-0.866$ (negative), the last sign combination: $$\mathbf C_3(300°)=\begin{pmatrix}0.5 & -0.866 & 0\\ 0.866 & 0.5 & 0\\ 0&0&1\end{pmatrix},\qquad \mathbf v^B=\begin{pmatrix}5.0\\ 8.66\\0\end{pmatrix}\text{ m/s}.$$ First component back to positive, second now positive too. Look at the intro figure and imagine the axes swung nearly a full turn — the fixed vector ends up leaning strongly into the new second axis. > **Verify:** every case: $\sqrt{8.66^2+5^2}=10$ (QII, QIII) and $\sqrt{5^2+8.66^2}=10$ (QIV) m/s ✓. All four sign combinations $(-,+),(-,-),(+,-)$ and the QI $(+,+)$ of Example 1 are now covered. --- ## Example 3 — degenerate / zero inputs (Cell C3) > [!example] > (a) A vector $\mathbf v^A=(3,-4,12)$ m/s is transformed by a **zero** rotation $\psi=0°$. (b) The zero vector $\mathbf v^A=(0,0,0)$ is transformed by any DCM. Give both results and explain. **Forecast:** what should a rotation "by nothing" do? What should any rotation do to a vector of length zero? 1. **Case (a): $\theta=0$ gives the identity.** *Why this step?* Plug $\theta=0$: $\cos0=1$, $\sin0=0$, so $$\mathbf C_3(0°)=\begin{pmatrix}1&0&0\\0&1&0\\0&0&1\end{pmatrix}=\mathbf I,\qquad \mathbf v^B=\mathbf I\,\mathbf v^A=(3,-4,12)\text{ m/s}.$$ The numbers are unchanged — the axes and the vector's description are identical because we never twisted anything. In the intro figure, this is the moment blue and green arrows coincide. This is the *degenerate baseline*: every DCM reduces to $\mathbf I$ when its angle is zero. 2. **Case (b): the zero vector is a fixed point.** *Why this step?* For any matrix $\mathbf C$, $\mathbf C\,\vec 0=\vec 0$. A vector of length zero has no direction to re-express, so **every** frame agrees it is $(0,0,0)$. > **Verify:** (a) $\mathbf I\,\mathbf v=\mathbf v$ leaves $(3,-4,12)$ untouched, length $\sqrt{9+16+144}=13$ before and after ✓. (b) length $0$ before and after ✓. --- ## Example 4 — limiting values $\theta\to90°,180°$ (Cell C4) > [!example] > Take $\mathbf v^A=(2,7,0)$ and transform by $\mathbf C_3$ at (a) $\theta=90°$ and (b) $\theta=180°$. Predict, then compute. **Forecast:** at $90°$ the axes swap roles; at $180°$ they point opposite. Guess how $(2,7)$ moves. 1. **$\theta=90°$: axis swap.** *Why this step?* $\cos90°=0,\ \sin90°=1$, so $$\mathbf C_3(90°)=\begin{pmatrix}0&1&0\\-1&0&0\\0&0&1\end{pmatrix},\qquad \mathbf v^B=\begin{pmatrix}0&1&0\\-1&0&0\\0&0&1\end{pmatrix}\begin{pmatrix}2\\7\\0\end{pmatrix}=\begin{pmatrix}7\\-2\\0\end{pmatrix}.$$ The old $\hat a_2$-component ($7$) becomes the new first component, and the old first ($2$) becomes the negated second — a clean $90°$ shuffle. In the intro figure, swing the green axes to exactly a quarter-turn: the new first axis lands where the old second one pointed. This is a memorable **sanity anchor**: whenever you doubt a sign, test your matrix at $90°$. 2. **$\theta=180°$: negation.** *Why this step?* $\cos180°=-1,\ \sin180°=0$, so $\mathbf C_3(180°)=\mathrm{diag}(-1,-1,1)$ and $$\mathbf v^B=(-2,-7,0).$$ The in-plane components simply flip sign because the axes now point backwards, while the axis-3 component is untouched (we rotated *about* it). > **Verify:** (a) $\sqrt{7^2+2^2}=\sqrt{53}$, same as $\sqrt{2^2+7^2}$ ✓. (b) $\sqrt{(-2)^2+(-7)^2}=\sqrt{53}$ ✓. Both preserve length. --- ## Example 5 — the $\mathbf C_2$ minus-sign trap (Cell C5) > [!example] > A pitch rotation of $\theta=30°$ about axis 2 acts on $\mathbf v^A=(1,0,0)$ m/s. Find $\mathbf v^B$ and confirm the minus sign sits where it should. **Forecast:** $\mathbf C_1$ and $\mathbf C_3$ put $-\sin$ *below* the diagonal. Will $\mathbf C_2$ do the same? (No — this is the trap.) > [!intuition] Why $\mathbf C_2$'s minus sits *above* the diagonal — the cyclic order made concrete > Recall the right-hand-rule cyclic order $1\to2\to3\to1$: each positive rotation carries an axis toward the **next** axis in this loop. For axis 3, positive $\theta$ sends $\hat a_1\to\hat a_2$ (the "$1$ then $2$" direction — *increasing* index), so the $+\sin$ appears in the upper-right and $-\sin$ lands *below*. For axis 2, positive $\theta$ sends $\hat a_3\to\hat a_1$ — that "wraps around" from index $3$ back to $1$, i.e. it runs the *opposite* way through the $(1,3)$ pair of slots. That reversal is exactly what flips the minus sign to the **upper** off-diagonal. Axis 1 ($\hat a_2\to\hat a_3$, increasing) behaves like axis 3. So $\mathbf C_2$ is the odd one out purely because its cyclic pair $(3\to1)$ counts *backwards* through the matrix indices. 1. **Write $\mathbf C_2$ from the definition, not from memory.** *Why this step?* Because axis-2 rotation follows the cyclic order $3\to1$ (explained above), its $-\sin$ lands on the **upper** off-diagonal (compare the three matrices in the intro formula box): $$\mathbf C_2(30°)=\begin{pmatrix}\cos30° & 0 & -\sin30°\\ 0&1&0\\ \sin30° & 0 & \cos30°\end{pmatrix}=\begin{pmatrix}0.866 & 0 & -0.5\\ 0&1&0\\ 0.5 & 0 & 0.866\end{pmatrix}$$ 2. **Apply.** *Why this step?* The data is an $A$-vector and $\mathbf C_2(30°)$ maps $A\to B$, so multiply directly: $$\mathbf v^B=\mathbf C_2(30°)\begin{pmatrix}1\\0\\0\end{pmatrix}=\begin{pmatrix}0.866\\0\\0.5\end{pmatrix}\text{ m/s}$$ The vector along old axis-1 picks up a **positive** axis-3 component ($+0.5$), which matches physical intuition: pitching the axes down tilts the once-horizontal vector so it now reads partly "up" in the new frame. > **Verify:** $\sqrt{0.866^2+0.5^2}=\sqrt{0.75+0.25}=1$ m/s ✓. The $-0.5$ entry never touched this vector (it multiplies the zero axis-3 input), but it *would* flip the sign of any axis-3 component — proving the minus lives in the upper slot. --- ## Example 6 — chained rotations & direction (Cell C6) > [!example] > A rocket's attitude is yaw $\psi=90°$ then pitch $\theta=30°$, so $\mathbf C^{BI}=\mathbf C_2(30°)\mathbf C_3(90°)$. A velocity measured in the **inertial** frame is $\mathbf v^I=(0,100,0)$ m/s. Find it in the **body** frame $\mathbf v^B$. **Forecast:** the data is inertial and we want body — do we use $\mathbf C^{BI}$ as-is, or its transpose? 1. **Match the inner index.** *Why this step?* $\mathbf C^{BI}$ reads *output $B$ ← input $I$* — it eats an inertial vector and returns a body vector. Our data is inertial, so we apply $\mathbf C^{BI}$ **directly**; no transpose needed. 2. **Build the composite (first rotation on the right).** *Why this step?* The yaw physically happens first, so $\mathbf C_3(90°)$ must touch the vector first — that means it sits **rightmost** in the product; putting it on the left would rotate in the wrong order since rotations do not commute: $$\mathbf C_3(90°)=\begin{pmatrix}0&1&0\\-1&0&0\\0&0&1\end{pmatrix},\quad \mathbf C_2(30°)=\begin{pmatrix}0.866&0&-0.5\\0&1&0\\0.5&0&0.866\end{pmatrix}$$ $$\mathbf C^{BI}=\mathbf C_2(30°)\mathbf C_3(90°)=\begin{pmatrix}0&0.866&-0.5\\-1&0&0\\0&0.5&0.866\end{pmatrix}$$ 3. **Apply.** *Why this step?* Multiply the composite into the inertial data to read the same physical velocity in body axes: $$\mathbf v^B=\mathbf C^{BI}\begin{pmatrix}0\\100\\0\end{pmatrix}=\begin{pmatrix}0(0)+0.866(100)-0.5(0)\\ -1(0)+0(100)+0\\ 0(0)+0.5(100)+0.866(0)\end{pmatrix}=\begin{pmatrix}86.6\\0\\50.0\end{pmatrix}\text{ m/s}$$ > **Verify:** $\sqrt{86.6^2+50^2}=\sqrt{7499.6+2500}=\sqrt{9999.6}\approx100$ m/s ✓. Order matters: had we used $\mathbf C_3(90°)\mathbf C_2(30°)$ instead we'd get a different — wrong — answer, because rotations do not commute. --- ## Example 7 — real-world thrust vectoring (Cell C7) > [!intuition] Key idea you need from [[Thrust vectoring and force resolution]] > When an engine gimbals, the thrust is a fixed vector *in the body frame* (you know its body components from the gimbal angle). To find how it accelerates the rocket through the sky, you must re-express that same arrow in the **inertial** frame — a pure DCM job. The deflection angle and the attitude angle simply **add** when they share a rotation axis, which is the sanity check below. > [!example] > A rocket's engine gimbals so its thrust points along the body direction $\hat u^B=(\cos5°,\,\sin5°,\,0)$ with magnitude $80{,}000$ N (a small $5°$ deflection from the body axis). The rocket's attitude relative to the ground is a pure yaw of $\psi=60°$: $\mathbf C^{BI}=\mathbf C_3(60°)$. What is the thrust vector in the **inertial** (ground) frame? **Forecast:** total ground thrust magnitude must stay $80{,}000$ N. The ground direction should be roughly $60°+5°=65°$ off inertial-$x$ — check this at the end. 1. **Form the body thrust vector.** *Why this step?* Magnitude times unit direction gives the body components: $$\mathbf F^B=80000\,(\cos5°,\sin5°,0)=(79695.6,\,6972.5,\,0)\text{ N}$$ 2. **Choose the right transform.** *Why this step?* We have a body vector, want inertial: $\mathbf F^I=\mathbf C^{IB}\mathbf F^B=(\mathbf C^{BI})^\top\mathbf F^B$, because $\mathbf C^{BI}$ maps inertial→body and we need the reverse, which for an orthogonal DCM is simply the transpose. Since $\mathbf C^{BI}=\mathbf C_3(60°)$, $$(\mathbf C^{BI})^\top=\mathbf C_3(60°)^\top=\begin{pmatrix}\cos60° & -\sin60° & 0\\ \sin60° & \cos60° & 0\\0&0&1\end{pmatrix}=\begin{pmatrix}0.5 & -0.866 & 0\\ 0.866 & 0.5 & 0\\0&0&1\end{pmatrix}$$ 3. **Apply the transform.** *Why this step?* Multiplying $(\mathbf C^{BI})^\top$ into the body thrust re-expresses that same physical force in ground axes — this is the actual answer to the question: $$\mathbf F^I=\begin{pmatrix}0.5 & -0.866 & 0\\ 0.866 & 0.5 & 0\\0&0&1\end{pmatrix}\begin{pmatrix}79695.6\\6972.5\\0\end{pmatrix}=\begin{pmatrix}0.5(79695.6)-0.866(6972.5)\\ 0.866(79695.6)+0.5(6972.5)\\0\end{pmatrix}=\begin{pmatrix}33809.7\\72499.8\\0\end{pmatrix}\text{ N}$$ > **Verify:** magnitude $\sqrt{33809.7^2+72499.8^2}\approx80000$ N ✓. Ground direction angle $\arctan(72499.8/33809.7)=65.0°=60°+5°$ ✓ — the yaw and gimbal angles add, exactly as the intuition box predicted. --- ## Example 8 — exam twist: recover the angle (Cell C8) > [!example] > You are handed a DCM that is a single rotation about axis 3: > $$\mathbf C_3(\theta)=\begin{pmatrix}0.6 & 0.8 & 0\\ -0.8 & 0.6 & 0\\0&0&1\end{pmatrix}$$ > Find the rotation angle $\theta$. (This runs the machine **backwards**.) **Forecast:** the top-left is $\cos\theta=0.6$ and the top-right is $\sin\theta=0.8$. Which quadrant? Both positive → quadrant I. 1. **Read off both trig values.** *Why this step?* For $\mathbf C_3$, entry $(1,1)=\cos\theta$ and entry $(1,2)=\sin\theta$. Having **both** lets us pin the quadrant — using only $\cos$ or only $\sin$ leaves a sign ambiguity. 2. **Use $\arctan$ with both signs — the tool for "which angle has this ratio?"** *Why $\arctan$ and not plain $\arccos$?* Because $\arccos$ can't tell $+\theta$ from $-\theta$ (cosine is even), whereas the two-argument arctangent, $\operatorname{atan2}(\sin\theta,\cos\theta)$, uses the signs of *both* to place the angle in the correct quadrant: $$\theta=\operatorname{atan2}(0.8,\,0.6)=53.13°$$ 3. **Cross-check with the recognisable triple.** *Why this step?* $0.6,0.8,1.0$ is the $3\text{-}4\text{-}5$ triangle scaled by $\tfrac15$, so $\theta=\arctan(4/3)=53.13°$ — the classic angle. This is why exam-setters love these numbers. > **Verify:** $\cos53.13°=0.6$ and $\sin53.13°=0.8$ ✓; $\arctan(0.8/0.6)=53.13°$ ✓. --- > [!recall]- Which cell would each new problem fall into? (all eight cells) > A yaw of $40°$ with both components positive ::: Cell C1 (quadrant I baseline, no sign surprises). > A yaw of $135°$ applied to a vector ::: Cell C2 (quadrant II — $\cos$ negative, $\sin$ positive). > Transform by $\theta=0$ or transform the zero vector ::: Cell C3 (identity / fixed point, nothing changes). > A rotation at exactly $90°$ or $180°$ used as a sign anchor ::: Cell C4 (limiting swap / negation). > Pitch about axis 2, worried about the minus sign ::: Cell C5 (upper off-diagonal, from cyclic order $3\to1$). > Have a body vector, want inertial, via two stacked rotations ::: Cell C6 (transpose + correct order). > Gimballed thrust: body force needed in ground axes ::: Cell C7 (real-world resolution, angles add). > Given a matrix, find its angle ::: Cell C8 (run backwards with atan2). > [!mnemonic] > **"Quadrant, zero, ninety, which-axis, which-direction, real-world, backwards"** — the ways a DCM problem can bite. If your exam question doesn't match one, you've misread it. See also: [[Euler angles — yaw pitch roll]], [[Orthogonal matrices and rotation groups SO(3)]], and for the moving-frame version [[Angular velocity and the kinematic equations]].