The parent note showed you why gimbal lock happens. This page makes you fluent by walking through every kind of situation that can arise — every sign of pitch, the zero case, the exact singularity, the near-singularity, a real aircraft, and an exam-style trap.
Before symbols: recall the three dials from the parent note.
ψ (yaw ) — turn left/right about the world vertical z .
θ (pitch ) — nose up/down about the tilted y .
ϕ (roll ) — barrel-roll about the nose x .
( p , q , r ) — the physical body spin rates the gyroscopes actually measure (roll-rate, pitch-rate, yaw-rate), in radians per second.
We will keep using the two maps from Euler angles :
R = R z ( ψ ) R y ( θ ) R x ( ϕ ) , ϕ ˙ θ ˙ ψ ˙ = call this E ( ϕ , θ ) 1 0 0 s ϕ t θ c ϕ c θ s ϕ c ϕ t θ − s ϕ c θ c ϕ p q r
where c α = cos α , s α = sin α , t α = tan α . The matrix E is the rate map : it converts real body spin into how fast your three dials must turn.
E is the whole story
Every disaster on this page comes from ONE fact: the bottom row of E divides by c θ = cos θ . When the nose points to a pole (θ = ± 90° ), cos θ = 0 , and you cannot divide by zero. That single division is the crack through which the whole representation falls apart.
Cell
What it tests
Hit by
A. Generic / safe
θ far from poles, all dials independent
Ex 1
B. Zero / identity
all angles 0 — degenerate but harmless
Ex 2
C. Exact lock θ = + 90°
matrix collapses to ( ϕ − ψ )
Ex 3
D. Exact lock θ = − 90°
matrix collapses to ( ϕ + ψ ) (opposite sign!)
Ex 4
E. Near-lock rate spike
1/ cos θ amplifies tiny rates
Ex 5
F. Non-unique inverse
many ( ψ , ϕ ) → one orientation
Ex 6
G. Real-world word problem
aircraft loop crossing zenith
Ex 7
H. Exam twist: quaternion escape
show quaternion stays finite where Euler explodes
Ex 8
Together these hit both signs of the pole, the zero case, a generic case, the limit as θ → 90° , uniqueness, a real vehicle, and the contrasting fix.
A drone holds ψ = 30° , θ = 20° , ϕ = 10° with body rates p = 0.5 , q = 0.2 , r = 0.1 rad/s. Are the Euler rates finite and well-behaved?
Forecast: Pitch is nowhere near ± 90° , so guess: everything finite, no drama.
Check the danger term. cos θ = cos 20° ≈ 0.9397 . Why this step? The only thing that can blow up is 1/ cos θ ; if cos θ is comfortably non-zero, we are safe.
Compute θ ˙ (middle row, no division): θ ˙ = c ϕ q − s ϕ r = cos 10° ( 0.2 ) − sin 10° ( 0.1 ) .
≈ 0.9848 ( 0.2 ) − 0.1736 ( 0.1 ) = 0.1970 − 0.01736 = 0.1796 rad/s. Why this step? Pitch-rate never divides by cos θ , so it is the "clean" component — a good baseline.
Compute ψ ˙ (bottom row): ψ ˙ = c θ s ϕ q + c θ c ϕ r = cos 20° sin 10° ( 0.2 ) + cos 10° ( 0.1 ) .
= 0.9397 0.1736 ( 0.2 ) + 0.9848 ( 0.1 ) = 0.9397 0.03473 + 0.09848 ≈ 0.1418 rad/s. Why this step? This row carries the singular factor; we confirm it is a modest number, not a blow-up.
Verify: All three rates are of order 0.1 –0.2 rad/s — same magnitude as the body rates. Sensible. Units: (dimensionless)× (rad/s) = rad/s. ✓
All angles zero: ψ = θ = ϕ = 0 . Body rates ( p , q , r ) = ( 0.3 , 0.4 , 0.5 ) . What is R , and what is E ?
Forecast: Zero angles = "do nothing" orientation. Guess: R is the identity and E is the identity, so Euler rates just equal body rates.
Build R . Each elemental matrix at angle 0 is the identity, and identity times identity is identity: R = I 3 . Why this step? Confirms zero angles are a perfectly valid, non-singular orientation — degenerate in value but not broken .
Evaluate E ( 0 , 0 ) . With s ϕ = 0 , c ϕ = 1 , t θ = 0 , c θ = 1 :
E ( 0 , 0 ) = 1 0 0 0 1 0 0 0 1 = I 3 .
Why this step? At the origin the three dials line up with the three body axes exactly, so no mixing happens.
Read the rates. ( ϕ ˙ , θ ˙ , ψ ˙ ) = ( p , q , r ) = ( 0.3 , 0.4 , 0.5 ) . Why this step? Shows the "best case": Euler rates equal body rates one-for-one.
Verify: det R = 1 (a proper rotation, part of Rotation matrices SO(3) ). cos 0 = 1 = 0 , so no singularity. ✓
Set θ = + 90° , keep ψ , ϕ symbolic. Show the matrix depends only on ( ϕ − ψ ) , and check with ( ψ , ϕ ) = ( 30° , 0° ) .
Forecast: Parent note promised the collapse to ( ϕ − ψ ) . Guess: yaw and roll fuse into one difference.
Insert R y ( 90° ) . With c θ = 0 , s θ = 1 , R y ( 90° ) = 0 0 − 1 0 1 0 1 0 0 . Why this step? We test the suspected singular value head-on.
Multiply out R z ( ψ ) R y ( 90° ) R x ( ϕ ) to get the parent's collapsed form:
R = 0 0 − 1 sin ( ϕ − ψ ) cos ( ϕ − ψ ) 0 cos ( ϕ − ψ ) − sin ( ϕ − ψ ) 0 .
Why this step? Every free entry is a function of the single number ϕ − ψ — that IS the lost degree of freedom made visible.
Plug ( ψ , ϕ ) = ( 30° , 0° ) , so ϕ − ψ = − 30° . Then top-middle entry = sin ( − 30° ) = − 0.5 , top-right = cos ( − 30° ) ≈ 0.8660 . Why this step? Turns the abstract collapse into a concrete number we can machine-check.
Verify: In Ex 6 we reach the same matrix from a different ( ψ , ϕ ) , proving the collapse. det R = 1 still. ✓
Now nose-down to the nadir: θ = − 90° . Show the collapse combination flips sign to ( ϕ + ψ ) .
Forecast: By symmetry guess the combination becomes ϕ + ψ , not ϕ − ψ . Sign matters!
Insert R y ( − 90° ) . Now c θ = 0 , s θ = − 1 , giving R y ( − 90° ) = 0 0 1 0 1 0 − 1 0 0 . Why this step? The − 1 where before we had + 1 is the seed of the sign flip.
Multiply out. The result is
R = 0 0 1 − sin ( ϕ + ψ ) cos ( ϕ + ψ ) 0 − cos ( ϕ + ψ ) − sin ( ϕ + ψ ) 0 .
Why this step? Confirms both poles collapse — you cannot escape lock by picking the other pole; you only change which combination survives.
Sanity with ( ψ , ϕ ) = ( 20° , 10° ) : ϕ + ψ = 30° , so top-middle = − sin 30° = − 0.5 , top-right = − cos 30° ≈ − 0.8660 . Why this step? Makes the ( ϕ + ψ ) dependence concrete and checkable.
Verify: Compare Ex 3 (uses ϕ − ψ ) with this (uses ϕ + ψ ). Both are singular, opposite combinations. ✓
Body rate r = 0.01 rad/s (a whisper), ϕ = 0 , p = q = 0 . Compute ψ ˙ at θ = 85° , 89° , 89.9° , 89.99° . Watch it diverge.
Forecast: As θ → 90° , cos θ → 0 , so ψ ˙ = r / cos θ should scream upward. Guess: it roughly × 10 each time θ gets 10 × closer to 90° .
Isolate the formula. With ϕ = 0 : ψ ˙ = c θ c ϕ r = cos θ r . Why this step? Strips away everything but the singular division so the blow-up is naked.
Tabulate:
θ = 85° : cos 85° = 0.08716 ⇒ ψ ˙ = 0.01/0.08716 ≈ 0.1147 rad/s.
θ = 89° : cos 89° = 0.01745 ⇒ ψ ˙ ≈ 0.5730 rad/s.
θ = 89.9° : cos 89.9° = 0.001745 ⇒ ψ ˙ ≈ 5.730 rad/s.
θ = 89.99° : cos 89.99° = 0.0001745 ⇒ ψ ˙ ≈ 57.30 rad/s.
Why this step? Numbers prove it is a region , not a point — already at 85° the rate is amplified, and it grows without bound.
Read the limit. As θ → 90° , ψ ˙ → ∞ for any r = 0 . Why this step? The math demands infinite dial-speed to represent a finite, gentle physical turn — the coordinate chart is singular (Singularities of coordinate charts ).
Verify: Each tenfold approach to 90° multiplies ψ ˙ by ≈ 10 — exactly 1/ cos θ behaviour. Physical rate r stayed 0.01 throughout; only the representation exploded. ✓
At θ = + 90° , take ( ψ , ϕ ) = ( 50° , 20° ) . Show it yields the SAME R as Ex 3's ( 30° , 0° ) .
Forecast: ϕ − ψ = 20 − 50 = − 30° , identical to Ex 3. Guess: exact same matrix.
Compute the combination. ϕ − ψ = 20° − 50° = − 30° . Why this step? Only this difference feeds the collapsed matrix, so equal differences must give equal matrices.
Fill the entries. sin ( − 30° ) = − 0.5 , cos ( − 30° ) ≈ 0.8660 — identical to Ex 3. Why this step? Confirms two different dial settings map to one orientation.
Interpret. The map orientation→ Euler is many-to-one at lock, so no attitude estimator (Attitude determination and control ) can recover a unique ( ψ , ϕ ) . Why this step? This is the estimation catastrophe, not just cosmetic.
Verify: Matrices from Ex 3 and Ex 6 are element-wise equal. ✓
A jet flies a vertical loop. At the top of the climb its nose passes through straight-up (θ = 90° ) while rolling at q = 1 rad/s (pitch-rate) and yawing at r = 0.02 rad/s from a crosswind gust, with ϕ = 0 . What Euler pitch-rate and yaw-rate does the onboard Euler-angle filter report at θ = 89.95° ?
Forecast: Pitch-rate uses the clean middle row (fine); yaw-rate uses 1/ cos θ (spike). Guess: θ ˙ ≈ 1 , ψ ˙ huge.
Middle row (pitch-rate). θ ˙ = c ϕ q − s ϕ r = cos 0 ( 1 ) − sin 0 ( 0.02 ) = 1 rad/s. Why this step? Confirms the physically dominant rotation is reported faithfully — the filter isn't wrong everywhere.
Bottom row (yaw-rate). cos 89.95° = 0.0008727 , so ψ ˙ = c θ c ϕ r = 0.0008727 0.02 ≈ 22.92 rad/s. Why this step? A 0.02 rad/s gust becomes a 22.9 rad/s reported yaw-rate — utterly unphysical for an aircraft (that's > 1300° /s).
Engineering consequence. The integrator overshoots heading wildly; the Apollo Guidance Computer famously worked around such lock by design. Why this step? Ties the abstract spike to a mission-critical failure mode.
Verify: θ ˙ = 1 rad/s is finite and sane; ψ ˙ ≈ 22.9 rad/s dwarfs the 0.02 rad/s cause by ≈ 1146 × = 1/ cos 89.95° . ✓
Same physical state as Ex 7 (θ = 89.95° , tiny gust). A quaternion filter propagates q ˙ = 2 1 q ⊗ ω with ω = ( p , q , r ) = ( 0 , 1 , 0.02 ) . Is the quaternion rate finite where the Euler rate exploded?
Forecast: Quaternions have no 1/ cos θ anywhere. Guess: rate stays of order the body rate — totally finite.
Bound the rate. The magnitude of the quaternion derivative is ∣ q ˙ ∣ = 2 1 ∣ q ∣∣ ω ∣ , and a unit quaternion has ∣ q ∣ = 1 . Why this step? No division by any coordinate term appears — that's the structural difference from E .
Plug in. ∣ ω ∣ = 0 2 + 1 2 + 0.0 2 2 = 1.0004 ≈ 1.0002 rad/s, so ∣ q ˙ ∣ ≈ 2 1 ( 1 ) ( 1.0002 ) ≈ 0.5001 per second. Why this step? Same physical state, but the quaternion rate is a tame ≈ 0.5 — while Ex 7's ψ ˙ was ≈ 22.9 .
Conclude. The physics (ω ) was always finite; only the Euler chart was singular. Change charts to quaternions and the "explosion" disappears. Why this step? This is the whole moral of the chapter, proven numerically side-by-side.
Verify: ∣ q ˙ ∣ ≈ 0.5 per second (finite) vs Euler ψ ˙ ≈ 22.9 rad/s (spiking) for the identical body rate. ✓
Recall Which cell does each example cover?
Generic safe case ::: Ex 1 (Cell A)
Zero / identity ::: Ex 2 (Cell B)
Exact lock + 90° collapse to ( ϕ − ψ ) ::: Ex 3 (Cell C)
Exact lock − 90° collapse to ( ϕ + ψ ) ::: Ex 4 (Cell D)
Near-lock rate spike / limit ::: Ex 5 (Cell E)
Non-unique inverse ::: Ex 6 (Cell F)
Real aircraft loop ::: Ex 7 (Cell G)
Quaternion escape ::: Ex 8 (Cell H)
Hinglish version →
Euler angles — the representation these examples stress-test
Quaternions — the finite-rate escape in Ex 8
Rotation matrices SO(3) — the group whose det = 1 we checked
Angular velocity kinematics — the rate map E every example uses
Attitude determination and control — where the non-unique inverse (Ex 6) bites
Apollo Guidance Computer — historical work-around referenced in Ex 7
Singularities of coordinate charts — the deeper reason the chart, not the physics, fails