3.4.2 · D4Rocket Flight Mechanics

Exercises — Transformation between frames — direction cosine matrices

2,127 words10 min readBack to topic

Before we start, one reminder of the three tools we will lean on the whole way down. We define each again in plain words so nothing is used before it is built:

The elementary matrices, copied here so you never have to scroll:

\mathbf C_2(\theta)=\begin{pmatrix}\cos\theta & 0 & -\sin\theta\\ 0&1&0\\ \sin\theta & 0 & \cos\theta\end{pmatrix},\quad \mathbf C_1(\theta)=\begin{pmatrix}1&0&0\\ 0&\cos\theta & \sin\theta\\ 0&-\sin\theta&\cos\theta\end{pmatrix}$$ ![[deepdives/dd-physics-3.4.02-d4-s01.png]] The figure above shows the **passive** convention we use throughout: the black arrow is one physical vector; the grey axes are frame $A$; the orange axes are frame $B$ turned by $+\theta$. Notice the arrow never moves — only the axes we measure it against do. That is the whole story of a DCM. --- ## Level 1 — Recognition These check that you can *read* a DCM: identify its type, its inverse, its determinant, without heavy arithmetic. ### Exercise 1.1 Which single-axis rotation is this, and by what angle? $$\mathbf M=\begin{pmatrix}1&0&0\\0&\tfrac12&\tfrac{\sqrt3}{2}\\0&-\tfrac{\sqrt3}{2}&\tfrac12\end{pmatrix}$$ > [!recall]- Solution > The top-left is a lone $1$ with its row and column otherwise zero, so **axis 1** is untouched — this is a $\mathbf C_1$ rotation. Compare the lower-right block to $\mathbf C_1(\theta)$: $\cos\theta=\tfrac12$ and $\sin\theta=\tfrac{\sqrt3}{2}$ (sitting in the upper-right slot, matching $\mathbf C_1$'s $+\sin$ there). The angle whose cosine is $\tfrac12$ and sine is $\tfrac{\sqrt3}{2}$ is $\theta=60°$. > **Answer:** $\mathbf M=\mathbf C_1(60°)$. ### Exercise 1.2 Without computing, write the inverse of $\mathbf C_2(40°)$ in two different ways. > [!recall]- Solution > A rotation table's inverse is its transpose (rows are orthonormal, so $\mathbf C\mathbf C^\top=\mathbf I$). And undoing a $+40°$ spin is the same as spinning $-40°$. So: > $$\mathbf C_2(40°)^{-1}=\mathbf C_2(40°)^\top=\mathbf C_2(-40°).$$ > Both give $\begin{pmatrix}\cos40° & 0 & \sin40°\\0&1&0\\-\sin40° & 0 & \cos40°\end{pmatrix}$. ### Exercise 1.3 Is the matrix below a valid DCM (proper rotation)? Give the one-line reason. $$\mathbf N=\begin{pmatrix}0&1&0\\1&0&0\\0&0&1\end{pmatrix}$$ > [!recall]- Solution > Its rows are orthonormal, so $\mathbf N\mathbf N^\top=\mathbf I$ — that part passes. But $\det\mathbf N=-1$ (swapping two axes flips handedness). A proper rotation between two right-handed frames needs $\det=+1$. **Answer: no** — it is a reflection, not a rotation. > [!mistake] The L1 trap: "orthogonal is enough" > **Why it feels right:** you learned $\mathbf C\mathbf C^\top=\mathbf I$ is the DCM signature, so any matrix passing it looks legal. **The trap:** that test only proves the columns are orthonormal — a *mirror* ($\det=-1$) passes it too. **Fix:** always check **both** $\mathbf C\mathbf C^\top=\mathbf I$ *and* $\det=+1$. The determinant is what separates a rotation from a reflection. --- ## Level 2 — Application Now you plug numbers in and turn the crank. ### Exercise 2.1 Frame $B$ is the ground frame rolled (about axis 1) by $\phi=90°$. A vector $\mathbf v^A=(0,\,4,\,0)$ points along ground-$y$. Find $\mathbf v^B$. > [!recall]- Solution > $$\mathbf C_1(90°)=\begin{pmatrix}1&0&0\\0&0&1\\0&-1&0\end{pmatrix},\qquad > \mathbf v^B=\mathbf C_1(90°)\begin{pmatrix}0\\4\\0\end{pmatrix}=\begin{pmatrix}0\\0\\-4\end{pmatrix}.$$ > **What happened geometrically:** we spun the axes $+90°$ about $x$, so $\hat b_2$ swings up to where old $\hat a_3$ was and $\hat b_3$ swings to where $-\hat a_2$ was. The arrow, still pointing along old-$y$, now reads as pointing along $-\hat b_3$. Length check: $|\mathbf v^B|=4=|\mathbf v^A|$ ✓. ### Exercise 2.2 Same frame $B=\mathbf C_3(30°)$ as parent Example 1, but now the wind is $\mathbf v^A=(0,\,10,\,0)$ m/s (along ground-$y$). Find $\mathbf v^B$. > [!recall]- Solution > $$\mathbf v^B=\mathbf C_3(30°)\begin{pmatrix}0\\10\\0\end{pmatrix}=\begin{pmatrix}\sin30°\cdot10\\ \cos30°\cdot10\\0\end{pmatrix}=\begin{pmatrix}5.0\\ 8.66\\0\end{pmatrix}\text{ m/s}.$$ > **Why $+5$ this time (not $-5$ like Example 1)?** In Example 1 the vector lay along $\hat a_1$; rotating axes $+30°$ pushed it to *negative* $\hat b_2$. Here the vector lies along $\hat a_2$; that same axis rotation makes it lean toward *positive* $\hat b_1$. The sign flips because the vector started on a different axis. Length: $\sqrt{5^2+8.66^2}=10$ ✓. ### Exercise 2.3 A body vector $\mathbf u^B=(0,\,0,\,6)$ is given, and $\mathbf C^{BA}=\mathbf C_2(90°)$. Recover the vector in frame $A$. > [!recall]- Solution > We have a $B$-vector and want $A$, so we need $\mathbf C^{AB}=(\mathbf C^{BA})^\top$: > $$\mathbf C_2(90°)=\begin{pmatrix}0&0&-1\\0&1&0\\1&0&0\end{pmatrix},\qquad > (\mathbf C_2(90°))^\top=\begin{pmatrix}0&0&1\\0&1&0\\-1&0&0\end{pmatrix}.$$ > $$\mathbf u^A=\begin{pmatrix}0&0&1\\0&1&0\\-1&0&0\end{pmatrix}\begin{pmatrix}0\\0\\6\end{pmatrix}=\begin{pmatrix}6\\0\\0\end{pmatrix}.$$ > **Answer:** $\mathbf u^A=(6,0,0)$. > [!mistake] The L2 trap: applying the given matrix backwards > **Why it feels right:** you were *handed* $\mathbf C^{BA}$, so it feels like "the" matrix to multiply by. **The trap:** in 2.3 the data was a $B$-vector. $\mathbf C^{BA}$ only eats $A$-vectors (inner index must match). Multiplying $\mathbf C^{BA}\mathbf u^B$ rotates the wrong way. **Fix:** match the inner superscript to your data's frame; if it doesn't match, transpose first. --- ## Level 3 — Analysis Here you combine, invert, and reason about *why* a result comes out the way it does. ### Exercise 3.1 Build the full 3-2-1 attitude DCM for yaw $\psi=90°$, pitch $\theta=0°$, roll $\phi=0°$. Then state, in words, what physical orientation this represents. > [!recall]- Solution > With $\theta=\phi=0$, $\mathbf C_2(0)=\mathbf C_1(0)=\mathbf I$, so > $$\mathbf C^{BA}=\mathbf C_1(0)\mathbf C_2(0)\mathbf C_3(90°)=\mathbf C_3(90°)=\begin{pmatrix}0&1&0\\-1&0&0\\0&0&1\end{pmatrix}.$$ > **Physical meaning:** the body has yawed $90°$ about the shared vertical axis. Body-$x$ (nose) now points along inertial-$y$; that is why the first row of $\mathbf C^{BA}$, which *is* $\hat b_1$ written in $A$-coordinates, reads $(0,1,0)$. Nothing tilts, so axis 3 stays $(0,0,1)$. ### Exercise 3.2 Given $\mathbf C^{BI}=\mathbf C_2(30°)\mathbf C_3(90°)$ (parent Example 2), verify by direct multiplication that $\mathbf C^{BI}(\mathbf C^{BI})^\top=\mathbf I$, checking just the first row against itself and against the second row. > [!recall]- Solution > From the parent, $\mathbf C^{BI}=\begin{pmatrix}0&0.866&-0.5\\-1&0&0\\0&0.5&0.866\end{pmatrix}$. > Row 1 is $\mathbf r_1=(0,\,0.866,\,-0.5)$; row 2 is $\mathbf r_2=(-1,0,0)$. > $$\mathbf r_1\cdot\mathbf r_1=0+0.866^2+0.5^2=0.75+0.25=1\ ✓$$ > $$\mathbf r_1\cdot\mathbf r_2=(0)(-1)+0.866(0)+(-0.5)(0)=0\ ✓$$ > The rows are unit-length and mutually perpendicular — exactly the statement $\mathbf C^{BI}(\mathbf C^{BI})^\top=\mathbf I$. **Why it *must* hold:** each row is one body axis expressed in inertial coordinates, and body axes are orthonormal by construction. ### Exercise 3.3 Two frames are related by $\mathbf C^{CA}=\mathbf C^{CB}\mathbf C^{BA}$ with $\mathbf C^{BA}=\mathbf C_3(90°)$ and $\mathbf C^{CB}=\mathbf C_3(-90°)$. Compute $\mathbf C^{CA}$ and explain the result. > [!recall]- Solution > $$\mathbf C^{CA}=\mathbf C_3(-90°)\mathbf C_3(90°)=\mathbf C_3(-90°+90°)=\mathbf C_3(0°)=\mathbf I.$$ > (Rotations about the *same* axis add their angles.) **Why $\mathbf I$:** frame $C$ is spun $-90°$ from $B$, which is itself $+90°$ from $A$. The two cancel, so $C$ and $A$ coincide — no re-labelling needed, the identity table. > [!mistake] The L3 trap: adding angles across *different* axes > **Why it feels right:** in 3.3 the trick "same axis → add angles" worked beautifully, so you try it for $\mathbf C_2(30°)\mathbf C_3(90°)$ and write $\mathbf C(120°)$. **The trap:** angle-adding only works when both rotations share one axis. Different axes don't commute and produce a genuinely 3-D orientation. **Fix:** only collapse $\mathbf C_k(\alpha)\mathbf C_k(\beta)=\mathbf C_k(\alpha+\beta)$ when the subscript $k$ is *identical*; otherwise multiply the matrices out. --- ## Level 4 — Synthesis Now you assemble several ideas into one multi-step problem, like a real attitude calculation. ### Exercise 4.1 A rocket has attitude yaw $\psi=90°$, pitch $\theta=90°$, roll $\phi=0°$ (3-2-1 sequence). The thrust in the body frame is $\mathbf F^{body}=(F,0,0)$ N along the nose. Find the thrust direction in the inertial frame, and describe where the nose points. > [!recall]- Solution > Build $\mathbf C^{BI}=\mathbf C_1(0)\mathbf C_2(90°)\mathbf C_3(90°)$. With $\mathbf C_1(0)=\mathbf I$: > $$\mathbf C_2(90°)=\begin{pmatrix}0&0&-1\\0&1&0\\1&0&0\end{pmatrix},\quad \mathbf C_3(90°)=\begin{pmatrix}0&1&0\\-1&0&0\\0&0&1\end{pmatrix}.$$ > $$\mathbf C^{BI}=\mathbf C_2(90°)\mathbf C_3(90°)=\begin{pmatrix}0&0&-1\\-1&0&0\\0&1&0\end{pmatrix}.$$ > We have a body vector, want inertial, so transpose: > $$\mathbf F^I=(\mathbf C^{BI})^\top\begin{pmatrix}F\\0\\0\end{pmatrix} > =\begin{pmatrix}0&-1&0\\0&0&1\\-1&0&0\end{pmatrix}\begin{pmatrix}F\\0\\0\end{pmatrix} > =\begin{pmatrix}0\\0\\-F\end{pmatrix}.$$ > **Answer:** $\mathbf F^I=(0,0,-F)$ — the thrust points straight *down* along inertial $-z$. Equivalently the nose (body-$x$) points along inertial $-z$: the rocket has been yawed $90°$ then pitched its nose $90°$ over so it faces the ground. Magnitude $|\mathbf F^I|=F$ ✓, as any rotation preserves length. ### Exercise 4.2 Using the same $\mathbf C^{BI}$ from 4.1, an inertial gust pushes with $\mathbf g^I=(0,\,G,\,0)$ N (along inertial-$y$). Express the gust in the body frame, and say which body axis it loads. > [!recall]- Solution > Data is inertial, we want body, and $\mathbf C^{BI}$ eats inertial vectors — perfect, no transpose: > $$\mathbf g^{body}=\mathbf C^{BI}\begin{pmatrix}0\\G\\0\end{pmatrix} > =\begin{pmatrix}0&0&-1\\-1&0&0\\0&1&0\end{pmatrix}\begin{pmatrix}0\\G\\0\end{pmatrix} > =\begin{pmatrix}0\\0\\G\end{pmatrix}.$$ > **Answer:** $\mathbf g^{body}=(0,0,G)$ — the gust loads body axis 3 (a pure side/normal load, no axial component). This is the kind of number a structural engineer needs, and it comes straight from choosing the matrix whose inner index matched the data. > [!mistake] The L4 trap: transposing when you shouldn't > **Why it feels right:** in 4.1 you *had* to transpose (body data, inertial wanted), so transposing feels like the "safe default." **The trap:** in 4.2 the data was already inertial and $\mathbf C^{BI}$ already accepts inertial input — transposing would rotate the gust the wrong way. **Fix:** don't transpose by habit. Look at the *inner* superscript versus your data frame each time; transpose **only** if they disagree. --- ## Level 5 — Mastery One problem that ties orthogonality, composition, determinant, and geometry together — and covers a degenerate case. ### Exercise 5.1 A DCM is built as $\mathbf C^{BA}=\mathbf C_3(\psi)\mathbf C_2(\theta)\mathbf C_3(-\psi)$ for arbitrary $\psi$ with $\theta=180°$. (a) Show $\det\mathbf C^{BA}=+1$ regardless of $\psi$. (b) Compute $\mathbf C^{BA}$ explicitly for the degenerate value $\theta=180°$ and interpret it. > [!recall]- Solution > **(a)** The determinant of a product is the product of determinants, and each elementary rotation has $\det=+1$: > $$\det\mathbf C^{BA}=\det\mathbf C_3(\psi)\cdot\det\mathbf C_2(180°)\cdot\det\mathbf C_3(-\psi)=1\cdot1\cdot1=1.$$ > This holds for **every** $\psi$ — orientation-preserving maps composed still preserve orientation. > > **(b)** At $\theta=180°$: $\cos180°=-1,\ \sin180°=0$, so > $$\mathbf C_2(180°)=\begin{pmatrix}-1&0&0\\0&1&0\\0&0&-1\end{pmatrix}.$$ > Now sandwich it. Write $c=\cos\psi,\ s=\sin\psi$: > $$\mathbf C_3(\psi)=\begin{pmatrix}c&s&0\\-s&c&0\\0&0&1\end{pmatrix},\quad > \mathbf C_3(-\psi)=\begin{pmatrix}c&-s&0\\s&c&0\\0&0&1\end{pmatrix}.$$ > First $\mathbf C_2(180°)\mathbf C_3(-\psi)=\begin{pmatrix}-c&s&0\\s&c&0\\0&0&-1\end{pmatrix}$. Then multiply on the left by $\mathbf C_3(\psi)$: > $$\mathbf C^{BA}=\begin{pmatrix}c&s&0\\-s&c&0\\0&0&1\end{pmatrix}\begin{pmatrix}-c&s&0\\s&c&0\\0&0&-1\end{pmatrix} > =\begin{pmatrix}-c^2+s^2 & 2sc & 0\\ 2sc & s^2-c^2 & 0\\ 0&0&-1\end{pmatrix}.$$ > Using $c^2-s^2=\cos2\psi$ and $2sc=\sin2\psi$: > $$\mathbf C^{BA}=\begin{pmatrix}-\cos2\psi & \sin2\psi & 0\\ \sin2\psi & \cos2\psi & 0\\ 0&0&-1\end{pmatrix}.$$ > **Interpretation:** a $180°$ pitch flips the $z$-axis (bottom-right $=-1$) and the sandwiching yaws produce a *reflection-like* pattern in the top-left block — yet $\det=+1$, so it is still a proper rotation (a $180°$ turn about an axis lying in the $xy$-plane at angle $\psi$). For $\psi=0$ it reduces to $\mathrm{diag}(-1,1,-1)=\mathbf C_2(180°)$, our starting flip, confirming consistency. Quick check: taking $\psi=45°$ gives $2\psi=90°$, so $\mathbf C^{BA}=\begin{pmatrix}0&1&0\\1&0&0\\0&0&-1\end{pmatrix}$, whose determinant is $(0)(0)(-1)-\dots = +1$ ✓. > [!mistake] The L5 trap: assuming a $-1$ on the diagonal means a reflection > **Why it feels right:** you learned $\det=-1$ is a reflection, and here you *see* $-1$s sitting on the diagonal, so it "must" be improper. **The trap:** individual diagonal $-1$s say nothing about handedness — only the **whole determinant** does. Here two sign-flips multiply back to $+1$, keeping it a genuine rotation. **Fix:** judge properness by $\det$ of the entire matrix, never by spotting a stray $-1$. --- ## Wrap-up recall > [!recall]- One-line answers to the whole ladder > - L1: check **both** $\mathbf C\mathbf C^\top=\mathbf I$ and $\det=+1$. > - L2: match the inner superscript to your data frame; transpose only if mismatched. > - L3: add angles only for the *same* axis. > - L4: transpose is not a default — decide it from the superscripts each time. > - L5: properness is a property of the *full* determinant, not of any single entry. See also: [[Euler angles — yaw pitch roll]], [[Reference frames in rocketry — inertial, body, wind]], [[Orthogonal matrices and rotation groups SO(3)]], [[Thrust vectoring and force resolution]].