3.5.2Guidance, Navigation & Control (GNC)

Euler angles — roll φ, pitch θ, yaw ψ; rotation sequence (3-2-1 convention)

1,778 words8 min readdifficulty · medium6 backlinks

WHAT are we rotating?

Figure — Euler angles — roll φ, pitch θ, yaw ψ; rotation sequence (3-2-1 convention)

HOW: Deriving each elementary rotation from scratch

Passive rotation convention (we rotate the frame, coordinates of a fixed vector transform). A frame rotation by +α+\alpha transforms coordinates by the transpose of the vector-rotation — this puts the sin-\sin in the lower-left. So:

Rx(ϕ)=[1000cosϕsinϕ0sinϕcosϕ]R_x(\phi)=\begin{bmatrix}1&0&0\\0&\cos\phi&\sin\phi\\0&-\sin\phi&\cos\phi\end{bmatrix} Ry(θ)=[cosθ0sinθ010sinθ0cosθ]R_y(\theta)=\begin{bmatrix}\cos\theta&0&-\sin\theta\\0&1&0\\\sin\theta&0&\cos\theta\end{bmatrix} Rz(ψ)=[cosψsinψ0sinψcosψ0001]R_z(\psi)=\begin{bmatrix}\cos\psi&\sin\psi&0\\-\sin\psi&\cos\psi&0\\0&0&1\end{bmatrix}

Multiplying out (let ssin,ccoss\equiv\sin, c\equiv\cos):

Rnb=[cθcψcθsψsθsϕsθcψcϕsψsϕsθsψ+cϕcψsϕcθcϕsθcψ+sϕsψcϕsθsψsϕcψcϕcθ]R^b_n=\begin{bmatrix} c\theta c\psi & c\theta s\psi & -s\theta\\ s\phi s\theta c\psi - c\phi s\psi & s\phi s\theta s\psi + c\phi c\psi & s\phi c\theta\\ c\phi s\theta c\psi + s\phi s\psi & c\phi s\theta s\psi - s\phi c\psi & c\phi c\theta \end{bmatrix}

Worked Example 1 — Pure yaw of 90°

Vehicle at ϕ=0,θ=0,ψ=90\phi=0,\theta=0,\psi=90^\circ. Where does the nose (xbx_b) point in nav coordinates?

  • Why start here? With only yaw, Rnb=Rz(90)R^b_n=R_z(90^\circ), the simplest case to build confidence. Rz(90)=[010100001]R_z(90^\circ)=\begin{bmatrix}0&1&0\\-1&0&0\\0&0&1\end{bmatrix}
  • The nose direction in body frame is [1,0,0]T[1,0,0]^T. To express it in nav, use Rbn=(Rnb)TR^n_b=(R^b_n)^T: nosen=(Rnb)T[1,0,0]T=[0,1,0]T_n=(R^b_n)^T[1,0,0]^T=[0,1,0]^T = East.
  • Why this step? RnbR^b_n maps nav→body; the inverse (transpose, since rotations are orthogonal) maps body→nav. Nose swung from North to East — exactly a +90+90^\circ yaw. ✓

Worked Example 2 — Combined pitch + roll

ϕ=30,θ=20,ψ=0\phi=30^\circ,\theta=20^\circ,\psi=0. Find the third row of RnbR^b_n (the body-zz axis in nav coords).

  • Third row =[cϕsθcψ+sϕsψ,  cϕsθsψsϕcψ,  cϕcθ]=[c\phi s\theta c\psi+s\phi s\psi,\; c\phi s\theta s\psi - s\phi c\psi,\; c\phi c\theta].
  • With ψ=0\psi=0: =[cϕsθ,  sϕ,  cϕcθ]=[c\phi s\theta,\; -s\phi,\; c\phi c\theta].
  • Plug in: c30=0.866,s30=0.5,s20=0.342,c20=0.940c30=0.866, s30=0.5, s20=0.342, c20=0.940: =[0.866(0.342), 0.5, 0.866(0.940)]=[0.296, 0.5, 0.814]=[0.866(0.342),\ -0.5,\ 0.866(0.940)] = [0.296,\ -0.5,\ 0.814]
  • Why this step? The third row of RnbR^b_n tells us where the body "Down" axis points in nav frame; its downward tilt (zz-comp 0.814<10.814<1) reflects the vehicle no longer being level. ✓ (Check: magnitude 0.2962+0.52+0.8142=1.00\sqrt{0.296^2+0.5^2+0.814^2}=1.00, unit vector as required.)

Worked Example 3 — Recover angles

Given R13=0.5,R23=0.433,R33=0.75,R12=0,R11=0.866R_{13}=-0.5,\,R_{23}=0.433,\,R_{33}=0.75,\,R_{12}=0,\,R_{11}=0.866.

  • θ=arcsin(0.5)=30\theta=-\arcsin(-0.5)=30^\circ. Why: R13=sinθR_{13}=-\sin\theta.
  • ϕ=atan2(0.433,0.75)=30\phi=\operatorname{atan2}(0.433,0.75)=30^\circ. Why: ratio isolates roll.
  • ψ=atan2(0,0.866)=0\psi=\operatorname{atan2}(0,0.866)=0^\circ. ✓

Gimbal Lock


Active Recall

Recall Test yourself (hide the answers)
  • In 3-2-1, which axis do you rotate about first? → the 3rd axis (zz), i.e. yaw.
  • Why is Rnb=RxRyRzR^b_n = R_x R_y R_z and not the reverse product? → intrinsic 3-2-1 (about moved axes) equals extrinsic RxRyRzR_xR_yR_z on the original vector.
  • How do you recover pitch from RR? → θ=arcsin(R13)\theta=-\arcsin(R_{13}).
  • When does gimbal lock occur and why? → θ=±90\theta=\pm90^\circ; roll & yaw axes coincide, losing a DOF.
Recall Feynman: explain to a 12-year-old

Imagine your toy airplane. To point it any way you want, do three spins in order: first spin it flat like a merry-go-round (that's yaw — pointing the nose left/right). Then tip the nose up or down (pitch). Finally roll it sideways like it's turning (roll). Those three spin-amounts are the Euler angles. There's one tricky spot: if you point the nose straight up, the "flat spin" and the "roll spin" start doing the same thing, so the plane gets confused about which is which — that's gimbal lock.


Connections

What does the "3-2-1" in the 3-2-1 Euler convention refer to?
The order of axes rotated about: 3rd (z, yaw), then 2nd (y, pitch), then 1st (x, roll).
Write RnbR^b_n as a product of elementary rotations for 3-2-1.
Rnb=Rx(ϕ)Ry(θ)Rz(ψ)R^b_n = R_x(\phi)R_y(\theta)R_z(\psi).
How do you extract pitch θ\theta from the DCM?
θ=arcsin(R13)\theta = -\arcsin(R_{13}).
How do you extract roll and yaw from the DCM?
ϕ=atan2(R23,R33)\phi=\operatorname{atan2}(R_{23},R_{33}), ψ=atan2(R12,R11)\psi=\operatorname{atan2}(R_{12},R_{11}).
At what pitch angle does gimbal lock occur and what is lost?
At θ=±90\theta=\pm90^\circ; the roll and yaw axes align, losing one rotational degree of freedom.
Why is the passive rotation matrix's off-diagonal sign flipped vs the active one?
Passive (frame) rotation = transpose of active (vector) rotation, moving sin-\sin to the lower-left.
What physical axes are xb,yb,zbx_b, y_b, z_b in the aircraft body frame?
xbx_b out the nose, yby_b out the right wing, zbz_b down through the belly.

Concept Map

reoriented into

maps n vector into

split R into three spins

1st applied

2nd applied

3rd applied

elementary matrix

elementary matrix

elementary matrix

right-to-left compose

right-to-left compose

right-to-left compose

equals

Navigation frame n NED

Body frame b nose-wing-belly

Rotation matrix R b_n

Euler angles 3-2-1

Yaw psi about z

Pitch theta about new y

Roll phi about newest x

Rz psi

Ry theta

Rx phi

Product Rx Ry Rz

Hinglish (regional understanding)

Intuition Hinglish mein samjho

Socho tumhare paas ek toy airplane hai aur tumhe batana hai ki wo space mein kis taraf point kar raha hai. Ek hi baar mein poori orientation likhna mushkil hai, isliye hum use teen simple spins mein tod dete hain — yahi Euler angles hain. Aerospace mein hum 3-2-1 convention use karte hain: pehle yaw ψ (z-axis ke around, nose left-right ghumana), phir pitch θ (naye y-axis ke around, nose upar-neeche), aur last mein roll φ (naye x-axis ke around, wings ko bank karna). Naam "3-2-1" isliye kyunki axes ka order 3(z) → 2(y) → 1(x) hai.

Har ek elementary rotation ek simple matrix hai jisme sirf cos\cos aur sin\sin aate hain. In teeno ko multiply karke poora rotation matrix banta hai: Rnb=Rx(ϕ)Ry(θ)Rz(ψ)R^b_n = R_x(\phi)R_y(\theta)R_z(\psi). Yaad rakhna — order important hai, rotations commute nahi karte! Agar sequence ya sign galat rakha to answer bilkul badal jayega. Ye matrix nav frame (North-East-Down) ke vector ko body frame (nose-wing-belly) mein convert karta hai.

Ek important trap hai gimbal lock: jab pitch θ=±90\theta = \pm90^\circ ho jaye (nose bilkul upar/neeche), tab roll aur yaw ek hi kaam karne lagte hain, aur ek degree of freedom kho jaati hai — angles ambiguous ho jaate hain. Isiliye real GNC systems mein calculation ke liye quaternions ya DCM use karte hain, aur Euler angles sirf display/samajhne ke liye. Bas yaad rakho: "Ψwing, θilt, φlip" — yeh mnemonic tumhe order kabhi bhoolne nahi dega!

Go deeper — visual, from zero

Test yourself — Guidance, Navigation & Control (GNC)

Connections