3.5.2 · D2Guidance, Navigation & Control (GNC)

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

2,810 words13 min readBack to topic

Before line one, three plain-word promises:

  • A vector is just an arrow with a length and a direction — think of the nose of a toy plane.
  • A frame is a set of three arrows at right angles that we use as our "measuring sticks": one pointing forward, one right, one down. Coordinates of an arrow are just how far along each measuring stick it reaches.
  • Rotating a frame means picking up the measuring sticks and turning them, while the physical arrow stays put. The arrow's numbers change because we are now measuring it against turned sticks.

Step 1 — What a single 2D turn does to the measuring sticks

WHAT. Forget 3D for a moment. Take a flat sheet with two measuring sticks: (right) and (up). Turn the whole sheet counter-clockwise by an angle . Ask: where did the tips of the unit sticks land?

WHY. Every 3D rotation we need is secretly this one 2D turn happening in a flat plane, with the third axis just standing still. If we nail the 2D case once, we get all three 3D matrices for free.

PICTURE. In the figure, the old -stick (pale yellow) swings to a new spot; the old -stick (chalk blue) swings too. (Recall the hat means "length-1 stick"; the prime means "after the turn.")

The tip of the rotated -stick lands at horizontal amount and vertical amount :

The rotated -stick lands at:


Step 2 — From "turn the arrow" to "turn the frame" (the transpose)

WHAT. In Step 1 we turned the sticks counter-clockwise. But in aerospace we keep the physical arrow fixed and turn the frame under it. Turning the frame by looks, to the arrow's coordinates, exactly like turning the arrow by .

WHY. This is the whole meaning of a passive rotation: we never move the airplane's nose relative to the world; we only change which measuring sticks we read it against. Reading against turned sticks flips the sign of the angle.

PICTURE. Same picture, opposite spin. Where before the off-diagonal minus sat top-right, flipping (so ) moves the minus to the lower-left.

Stacking the coordinate rules as rows (each row says how to build one new coordinate) gives the passive 2D turn:


Step 3 — Embed the 2D turn in 3D: the yaw matrix

WHAT. Yaw is a flat spin about the vertical -axis (NED Down). The -stick doesn't move; the and sticks do the 2D turn from Step 2.

WHY. Yaw is the first rotation in 3-2-1 — the pilot points the nose left/right before anything else. Building it first matches the physical order. By the right-hand rule, positive is viewed looking along (i.e. downward), so nose-swings-toward-East is a positive yaw in NED.

PICTURE. Looking straight down the -axis, we see Step 2's picture exactly. The -row is : "the vertical coordinate is untouched."

  • Top-left block = the passive 2D turn in the plane.
  • The lone says the spin axis () keeps every -coordinate.

Step 4 — Pitch : same turn, different plane, watch the sign

WHAT. Pitch tips the nose up/down: a turn in the plane about the -axis. The -stick stays put.

WHY. Pitch is the second rotation. It happens about the -axis that yaw just repositioned. As a matrix it is again our 2D turn, but living in the plane. By the right-hand rule (thumb along ), positive raises the nose in NED.

PICTURE. Here is the one sign trap. If you label the axes in the order then and go counter-clockwise, the plane's "handedness" flips compared to Steps 3 and 5, so the minus lands top-right instead of lower-left.


Step 5 — Roll : the last spin, about the nose

WHAT. Roll banks the wings: a turn in the plane about the -axis (the nose). The -stick stays put.

WHY. Roll is the third and last rotation in 3-2-1, done about the nose axis that yaw and pitch already aimed. By the right-hand rule (thumb out the nose ), positive dips the right wing.

PICTURE. Sighting down the nose, we again see Step 2's flat turn, now in the plane; minus returns to lower-left.


Step 6 — Chaining the three spins: why the product reads right-to-left

WHAT. We now stack all three. A vector's nav coordinates () go in; after yaw, then pitch, then roll, its body coordinates () come out.

WHY. Matrices act on whatever is immediately to their right. We apply yaw first, so the vector meets first — meaning must sit rightmost (closest to the vector). Pitch acts on that result, so sits to its left; roll last, so is leftmost.

PICTURE. Read the arrow of operations right→left: the nav vector enters on the right, passes through each machine, exits as the body vector on the left.


Step 7 — Multiply it out, term by term

WHAT. Do the two matrix multiplications first, then , and collect. Using :

WHY. Attitude software stores this single Direction Cosine Matrix rather than re-multiplying three matrices every step — it is faster and it is what the Direction Cosine Matrix (DCM) entry propagates.

Notice the cleanest entries and what they mean:

  • Top-right : pitch alone sets it — no roll, no yaw contaminate it. That is why later.
  • Bottom-right column (entries ): they share , so their ratio is , and cancels — that is why .
  • First column-pair : share , ratio .

This whole rows-and-orthogonality structure is unpacked in Rotation matrices & orthogonality.


Step 8 — Recovering the angles: what is and why we need it

WHAT. Given the numbers , we run them backwards to get :

WHY and not plain ? The ratio alone cannot tell you the roll's quadrant: repeats every , so an angle and that angle plus give the same ratio. The two-argument is defined as "the angle whose sine has the sign of and whose cosine has the sign of " — it keeps both numbers separately, so it lands in the correct one of all four quadrants, returning a value in . That is exactly why we feed it and (not just their ratio): and carry the signs of and .

PICTURE. The figure shows one point in each quadrant sharing the same ratio; collapses them, separates them.

  • Branch of pitch. returns only , so is always taken in that band — the standard convention that keeps pitch bounded and roll/yaw free.

Step 9 — The degenerate cases: pitch to straight up AND straight down

WHAT. Two orientations break the recovery: (nose straight up) and (nose straight down). In both, , so every entry carrying dies: , and the ratios become .

WHY. With the nose vertical, the first spin (yaw, about world-Down) and the last spin (roll, about the now-vertical nose) turn about the same line. Two of our three knobs do the identical job — one degree of freedom vanishes. This is gimbal lock.

PICTURE. The yaw circle and the roll circle collapse onto one shared circle; only a combination of and is observable, not each separately.

Case (). The surviving entries collapse to a single combined angle :

Only appears — you can never split it back into a unique and .

Case (). Now the sign in front of every term flips, and the surviving combination becomes the sum :

Here only is observable. So both poles lock, but they lock onto different combinations ( up, down) — a subtlety worth seeing once.


The one-picture summary

The whole page in a single frame: nav (, NED) coordinates enter on the right, get spun by yaw → pitch → roll (right-to-left through the machines), and leave as body () coordinates — with both vertical-nose poles flagged in pink.

Recall Feynman retelling — the whole walkthrough in plain words

Picture turning a flat sheet: whatever you spin, one stick still points "along" (that's cosine) and part spills "sideways" (that's sine). That single fact is the seed of every rotation matrix. Because we hold the plane still and instead turn our measuring sticks, we spin the opposite way — which parks a minus sign in the lower-left corner. Now do that same little flat-turn three times, each in a different flat slice of 3D space, and each with the right-hand-rule sign: once looking down (that's yaw, and the up-down stick doesn't budge), once from the side (pitch — but this one flips its minus to the top corner because of how the axes wrap around), and once looking down the nose (roll). Our world sticks are North, East, Down (NED). To describe an airplane's attitude we do them in the pilot's order: aim the nose (yaw), lift it (pitch), bank the wings (roll). Because each matrix grabs whatever sits to its right, and yaw goes first, yaw sits rightmost, roll leftmost: , which turns nav numbers into body numbers. Multiply them and you get one tidy 3×3 table of cosines and sines — and it's tidy on purpose: the pure-pitch entry sits alone in a corner, and pairs of entries share a so their ratios hand you roll and yaw back cleanly (we use , which keeps both numbers so it knows the quadrant). The one place it breaks is nose-straight-up or straight-down: yaw and roll then spin about the very same line, two knobs doing one job, and you can never untangle them again. That's gimbal lock, and it's why the pros keep quaternions in their back pocket.


Connections

In , what do the subscript and superscript mean?
= navigation frame (NED: North-East-Down) is the input; = body frame (nose-right wing-belly) is the output.
What does a hat (as in ) denote here?
A unit vector — an arrow of length exactly 1 along that axis.
What sign convention fixes the direction of every positive Euler rotation?
The right-hand rule: thumb along the positive spin axis, curling fingers give positive rotation (CCW viewed from +axis).
Why use instead of for roll?
repeats every 180°; keeps both signs so it picks the correct quadrant in .
At and which angle combinations survive?
leaves only ; leaves only — gimbal lock at both poles.