Euler Angles: 3-2-1 Yaw Pitch Roll Examples, Exercises, and Solutions
This entry is the self study companion to Euler Angles: 3-2-1 yaw pitch roll.
The problems develop the intrinsic 3-2-1 sequence from its moving-frame geometry through the
passive direction cosine matrix, aerospace sign interpretation, inverse extraction, singularity,
quaternion representation, angular velocity relation, and numerical implementation.
All exercises are stated first. Complete worked solutions follow afterward.
1 Convention summary
PhysicsLibrary uses the passive coordinate map
For intrinsic 3-2-1 yaw pitch roll,
and
For a conventional aircraft body frame,
The common principal branch is
2 Visual reference
Figure. Intrinsic 3-2-1 frame chain: yaw about zA, pitch about y1, and roll about x2.
Figure. Positive yaw, pitch, and roll directions for the conventional Forward-Right-Down
body-axis interpretation.
Figure. At 𝜃 = ±90∘, the first and third physical rotation axes become collinear.
3 Exercises
- Map direction and chronological order.
State what
means physically. Then state the chronological intrinsic 3-2-1 frame rotations associated
with (ψ,𝜃,ϕ).
- Intermediate-frame construction.
Introduce A0,A1,A2,A3 for intrinsic 3-2-1 and write the three frame-labeled passive
coordinate maps. Show how they compose to form BC
A.
- Aerospace positive-angle interpretation.
For a Forward-Right-Down body frame, explain the physical sense of positive ψ,
positive 𝜃, and positive ϕ.
- Elementary passive matrices and single-axis checks.
Write C1(ϕ), C2(𝜃), and C3(ψ). Then state the three single-angle reductions of the
complete 3-2-1 DCM.
- Derive the full passive 3-2-1 DCM.
Starting from
multiply the matrices and obtain all nine elements.
- Interpret rows and columns.
For
state the geometric meaning of row i and column j. What does the first row represent
in the aerospace specialization?
- Recover yaw and pitch from the forward axis.
A body forward axis expressed in North-East-Down coordinates is
Assuming the principal branch, find yaw and pitch. Can roll be obtained from this
vector alone?
- Principal ranges.
State the common principal ranges for ψ, 𝜃, and ϕ. Explain why cos 𝜃 ≥ 0 on this
branch.
- Inverse DCM extraction.
For a nonsingular passive DCM
write the principal extraction formulas for 𝜃, ϕ, and ψ.
- Alternative pitch extraction.
Show why
is equivalent to the principal arcsine formula away from singularity.
- Numerical DCM.
Compute the passive 3-2-1 DCM for
- Numerical round trip and DCM checks.
Using the matrix from Exercise 11:
- recover (ψ,𝜃,ϕ);
- state the orthogonality check;
- state the determinant check;
- write the reverse coordinate map.
- Locate and interpret the singularity.
State the 3-2-1 singularity condition. Explain geometrically what happens to zA and x2 at
𝜃 = +90∘ and 𝜃 = −90∘.
- Exact coupling at positive ninety degrees.
Set
in the full 3-2-1 DCM and show that only one combination of yaw and roll remains
observable. Identify that combination.
- Exact coupling at negative ninety degrees.
Repeat Exercise 14 for
Which combination of yaw and roll remains observable?
- A singular-case software convention.
At 𝜃 = +90∘, suppose the original Euler angles are
The implementation chooses ϕ = 0 at singularity. What yaw should it return so that the
same orientation is represented?
- Equivalent extrinsic description.
Write the extrinsic sequence and chronological angle order equivalent to intrinsic
- Active versus passive.
If C = BC
A is the PhysicsLibrary passive 3-2-1 matrix, what active rotation matrix
represents the corresponding physical rotation? Explain why transposed formulas often
appear in references.
- Passive quaternion composition.
Write the passive Hamilton quaternion product corresponding to intrinsic 3-2-1. Then write
its four scalar-first components in terms of half-angle sines and cosines.
- Numerical quaternion consistency.
For
compute the passive quaternion and state the DCM consistency relation that should
hold.
- Euler rates to body angular velocity.
At
let
Compute the body angular velocity components (p,q,r).
- Body angular velocity to Euler rates.
At the same attitude, suppose
Recover (ϕ,𝜃,ψ). Why does this inverse relation become singular at 𝜃 = ±90∘?
- Small-angle approximation.
Derive the first-order passive DCM for small (ϕ,𝜃,ψ) and express it using the cross-product
matrix of
- Exact relative attitude versus Euler subtraction.
Two body attitudes relative to the same reference frame are
and
First form the naive Euler-coordinate difference. Then describe the correct DCM
operation for the exact relative attitude. The exact relative 3-2-1 principal angles are
approximately
Explain what this comparison demonstrates.
- Convention and implementation audit.
A source says only “use yaw pitch roll.” List at least eight convention or implementation
questions that should be answered before directly copying its formulas into a PhysicsLibrary
implementation.
4 Solutions
Solution 1: map direction and chronological order
The equation
means that the physical vector is unchanged while its coordinates are re-expressed from frame A
into frame B.
The chronological intrinsic rotations are
Thus the first axis belongs to the initial frame, while the second and third axes belong to
successive intermediate frames.
Solution 2: intermediate-frame construction
Let
The three passive frame maps are
and
Matching adjacent frame labels gives
Solution 3: aerospace positive-angle interpretation
For Forward-Right-Down axes:
- positive yaw rotates the current x axis toward the current y axis;
- positive pitch rotates the current x axis toward the negative current z direction,
corresponding to nose up;
- positive roll rotates the current y axis toward the current z axis, corresponding to right
wing down.
These are physical frame rotations following the right hand rule.
Solution 4: elementary passive matrices and single-axis checks
The passive elementary matrices are
and
Therefore
and
Solution 5: derive the full passive 3-2-1 DCM
Use
with analogous notation for 𝜃 and ψ.
First,
Premultiplication by C1(ϕ) gives
Solution 6: interpret rows and columns
For
its entries satisfy
Thus row i is the body basis vector eiB expressed in frame A, and column j is the reference basis
vector ejA expressed in frame B.
The first row is the body forward axis expressed in the reference frame:
Solution 7: recover yaw and pitch from the forward axis
The horizontal components are equal and positive, so
The Down component gives
hence
Roll cannot be determined from the forward axis alone because the final roll is about that same
forward axis and therefore does not change its direction.
Solution 8: principal ranges
A common principal branch is
and
Because 𝜃 lies between minus and plus ninety degrees,
Solution 9: inverse DCM extraction
Away from the singularity,
and
The two-argument arctangent is required to preserve the correct quadrant.
Solution 10: alternative pitch extraction
From the first row of the DCM,
Therefore
On the principal branch, c𝜃 ≥ 0, so
Since
the atan2 expression uses (sin 𝜃, cos 𝜃) and returns the same principal pitch.
Solution 11: numerical DCM
For
Solution 12: numerical round trip and DCM checks
The extraction equations give
and
Thus
A valid DCM must satisfy
and
The reverse map is
Solution 13: locate and interpret the singularity
The singularity condition is
so
At 𝜃 = +90∘, the third rotation axis x
2 is anti-aligned with the first rotation axis zA:
At 𝜃 = −90∘, they are aligned:
The physical orientation remains valid; only the Euler coordinate chart loses local uniqueness.
Solution 14: exact coupling at positive ninety degrees
Setting
in the full DCM gives
Only
appears. Therefore yaw and roll cannot be recovered independently.
Solution 15: exact coupling at negative ninety degrees
At
Only
is observable.
Solution 16: a singular-case software convention
At positive ninety degrees,
For the original angles,
If software imposes
then it must satisfy
Therefore it should return
This new pair represents the same singular orientation because the observable combination remains
ϕ − ψ = −30∘.
Solution 17: equivalent extrinsic description
Reverse the axis order and angle association:
Both descriptions produce the same final orientation and the same passive DCM.
Solution 18: active versus passive
The corresponding active rotation matrix is
Thus an active-vector reference can legitimately display the transpose of the PhysicsLibrary
passive coordinate map. Apparent sign or factor-order conflicts should be investigated at the
transformation-semantics level before being called errors.
Solution 19: passive quaternion composition
For a positive passive frame rotation,
Therefore
Define
with analogous notation for 𝜃 and ψ.
Using Hamilton multiplication and scalar-first storage,
Solution 20: numerical quaternion consistency
For
the passive quaternion is approximately
It should have unit norm to numerical precision and satisfy
This is one of the strongest convention checks available because it compares two independent
attitude representations.
Solution 21: Euler rates to body angular velocity
For intrinsic 3-2-1,
At ϕ = 10∘, 𝜃 = 20∘, and the stated Euler rates,
and
Thus (p,q,r) are not simply (ϕ,𝜃,ψ).
Solution 22: body angular velocity to Euler rates
Away from the singularity,
Substitution gives approximately
The inverse contains tan 𝜃 and 1∕ cos 𝜃. It therefore becomes singular when
This is the same geometric singularity found in the Euler coordinate chart.
Solution 23: small-angle approximation
For small angles,
Keeping only first-order terms gives
Define
Then
This local relationship does not make finite yaw pitch roll triples ordinary vectors.
Solution 24: exact relative attitude versus Euler subtraction
The naive coordinate difference is
Let
The exact passive relative map from frame B1 coordinates to frame B2 coordinates
is
For the stated attitudes,
Extracting intrinsic 3-2-1 principal angles gives approximately
This differs from (5∘, 3∘, 3∘) because Euler coordinates are nonlinear sequence-dependent
coordinates. Exact finite relative attitude must be formed by attitude composition rather than
coordinate subtraction.
Solution 25: convention and implementation audit
Before copying a yaw pitch roll formula, determine at least:
- whether the sequence is intrinsic or extrinsic;
- whether the transformation is active or passive;
- the coordinate-map direction;
- whether vectors are represented as columns or rows;
- the positive-angle convention;
- whether 3-2-1 denotes chronological rotations or written matrix factor order;
- the reference-frame axis directions, such as North-East-Down or East-North-Up;
- the body-axis convention, such as Forward-Right-Down;
- the principal Euler Angle ranges;
- the singular-case extraction policy;
- the quaternion multiplication and storage conventions if quaternions are also used;
- whether body angular velocity or Euler angle rates are being supplied by the software
interface.
A robust implementation should also verify zero-angle and single-axis cases, orthogonality,
determinant +1, transpose reversal, DCM-to-Euler round trips, quaternion agreement, and
expected behavior near the pitch singularity.
5 Compact review
The passive intrinsic 3-2-1 map is
Away from singularity,
and
The singularity is
with outer-angle coupling
and
The passive quaternion is
Body angular velocity and Euler coordinate rates are related by a state-dependent matrix and are
not generally equal component by component.
6 Sources and exercise provenance
The exercises and worked solutions in this companion are newly written for PhysicsLibrary to
reinforce the convention and derivations developed in Euler angles: 3-2-1 yaw pitch
roll.
References
[1] D. M. Henderson, Euler Angles, Quaternions, and Transformation Matrices: Working
Relationships, JSC-12960, NASA Johnson Space Center, 1977. NASA Technical Reports
Server
[2] Federal Aviation Administration, Pilot’s Handbook of Aeronautical Knowledge,
FAA-H-8083-25C, 2023. FAA Pilot’s Handbook of Aeronautical Knowledge
[3] J. Diebel, “Representing Attitude: Euler Angles, Unit Quaternions, and Rotation
Vectors,” Stanford University, 2006. Online PDF
[4] SciPy Developers, “Rotation.from_euler,” SciPy documentation. SciPy Euler rotation
documentation
License
Unless otherwise noted, this PhysicsLibrary entry is intended for release under the Creative
Commons Attribution ShareAlike 4.0 International license.