|
|
|
Main Menu
|
|
Sections
Meta
Talkback
Downloads
Information
|
|
|
|
|
example of Euler angles: direction cosine matrix to Euler angles
|
(Example)
|
|
Euler Angles: Direction Cosine Matrix to Euler Angles Examples, Exercises, and Solutions
This entry is the self study companion to Euler Angles: direction cosine matrix to Euler
angles.
The exercises develop the inverse attitude problem from basic convention recognition through
numerical extraction, branch selection, singularity handling, DCM validation, reconstruction
checks, and software-oriented diagnostics. The same passive intrinsic convention used throughout
the PhysicsLibrary Euler series is retained.
All exercises appear first. Complete worked solutions follow afterward.
1 Convention summary
PhysicsLibrary uses
For an intrinsic i-j-k Euler sequence,
For Tait Bryan sequences the standard middle-angle branch is
while for proper Euler sequences it is
The outer angles are commonly normalized to
2 Visual reference
Figure. A sequence-aware DCM-to-Euler workflow. Both the singular and nonsingular
branches ultimately produce an Euler representative that must be normalized to the
selected principal convention before reconstruction and verification.
Figure. The matrix elements used for intrinsic 3-2-1 and 3-1-3 extraction. The required
elements depend on the selected sequence.
Figure. Common principal middle-angle branches for Tait Bryan and proper Euler
sequences.
3 Exercises
- What information is missing from “DCM to Euler angles”?
Explain why a direction cosine matrix does not determine a unique Euler triple until
additional choices are specified. List at least four such choices.
- Passive map direction.
A vector has coordinates
and the passive DCM from A coordinates to B coordinates is
Compute Bv. What physical object has changed: the vector itself or only its
coordinates?
- Is the input a proper rotation matrix?
For
compute the dot product of the second and third rows and their squared norms. Is M
exactly orthogonal? Should Euler extraction silently assume that it is?
- Why determinant matters.
Consider
Show that RRT = I but det R = −1. Why is R not a valid attitude DCM?
- Why use atan2?
Suppose a pair of DCM elements is proportional to
Compute λ using atan2 and compare with the result from arctan(y∕x). Explain the
quadrant problem.
- Derive the 3-2-1 middle-angle formula.
For intrinsic passive 3-2-1,
Using
derive the principal-branch formula
- Derive 3-2-1 yaw and roll extraction.
Away from the 3-2-1 singularity, derive formulas for ψ and ϕ from the DCM elements.
- Numerical 3-2-1 extraction.
For
recover the principal intrinsic 3-2-1 angles (ψ,𝜃,ϕ).
- Reconstruction check for 3-2-1.
Using the angles found in the previous exercise, reconstruct
State what a small reconstruction residual tells you and name three errors that a large
residual could reveal.
- Active/passive transpose trap.
The same numerical orientation relationship is represented actively by
Suppose a software library returns the active matrix but the PhysicsLibrary 3-2-1
extraction formulas are applied to it as though it were passive. Why should the resulting
Euler angles not be trusted even if they look plausible?
- Derive the 3-1-3 middle-angle formula.
For intrinsic passive 3-1-3,
use
to derive a robust principal-branch formula for β.
- Derive 3-1-3 outer-angle extraction.
Away from sin β = 0, derive formulas for α and γ from the 3-1-3 DCM.
- Numerical 3-1-3 extraction.
For
recover the principal intrinsic 3-1-3 triple (α,β,γ).
- Tait Bryan principal branch.
Why does the standard Tait Bryan middle-angle range
make
rather than | cos β| ambiguous inside the extraction formulas? Where are the singular
endpoints?
- Proper Euler principal branch.
Why does
make
on the principal branch? Where are the two singular endpoints?
- 3-2-1 singularity at positive ninety degrees.
A 3-2-1 orientation is generated by
At this singularity the software policy sets ϕ = 0 and uses
What yaw does the policy report? Why is it different from the original 50∘ yet still
represents the same physical orientation when combined with 𝜃 = 90∘ and ϕ = 0?
- 3-2-1 singularity at negative ninety degrees.
Repeat the previous exercise for
What yaw is reported under the same ϕ = 0 policy?
- 3-1-3 singularity at beta equals zero.
For intrinsic 3-1-3, set β = 0 and show that the DCM depends only on α + γ. If a
singular policy sets γ = 0, what should be reported for α?
- 3-1-3 singularity at beta equals pi.
Set β = π and show that only α−γ is observable. Under the same γ = 0 policy, derive
the reported α.
- Normalize, do not blindly modulo every angle.
Explain the difference between
and
Why should the middle angle not simply be treated as another freely wrapped
2π-periodic coordinate?
- Alternate 3-2-1 branch.
Show that the two intrinsic 3-2-1 triples
and
produce the same DCM, even though only the first lies on the usual Tait Bryan principal
branch.
- A non-3-2-1 Tait Bryan example.
For intrinsic 1-3-2,
and the DCM is
Using the sequence-specific formulas
and
recover the principal angles.
- A non-3-1-3 proper Euler example.
For intrinsic 2-3-2,
and
Use
and
to recover the principal angles.
- Near-singular conditioning.
For a Tait Bryan sequence, the outer-angle extraction becomes poorly conditioned as
| cos β| approaches zero. Compare
with
by computing | cos β| for each. Approximately how many times smaller is the common
outer-angle scale factor at 89.9∘?
- relative attitude and final implementation audit.
Frame B1 has intrinsic 3-2-1 angles
and frame B2 has
both relative to frame A.
Explain why simple componentwise subtraction is not the exact finite relative attitude.
Form the correct expression
and state the approximate principal 3-2-1 relative angles obtained by extracting from
this matrix.
Finally, list at least six checks that should appear in a production DCM-to-Euler
implementation.
4 Solutions
- What information is missing from “DCM to Euler angles”?
A DCM stores the orientation itself, whereas Euler angles are coordinates of that
orientation in a chosen chart. The inverse map is therefore not unique until the chart
is specified.
At minimum one must specify:
- the Euler sequence, such as 3-2-1 or 3-1-3;
- intrinsic versus extrinsic interpretation;
- active versus passive matrix convention;
- DCM map direction, such as BC
A versus AC
B;
- principal angle ranges;
- a singularity / gauge policy;
- an angle-wrapping convention for the outer angles.
Thus the meaningful inverse operation is
- Passive map direction.
Apply the passive coordinate map:
Hence
The physical vector has not changed. Only the coordinates used to describe that same vector
have changed from frame A to frame B.
- Is the input a proper rotation matrix?
Let the second and third rows be
Their dot product is
Their squared norms are
and the same for r3.
Thus the rows are mutually perpendicular but not exactly unit length. Therefore
exactly.
Euler extraction should not silently assume arbitrary input matrices are perfect rotations. A
production implementation should test orthogonality and determinant and, when
appropriate, repair a noisy matrix before extraction.
- Why determinant matters.
Because R is diagonal,
However,
A proper three-dimensional rotation must lie in SO(3) and therefore satisfy
The matrix R is an improper orthogonal transformation containing a reflection. It is not a
physically valid attitude DCM.
- Why use atan2?
Take
Then
By contrast,
The tangent is the same for angles differing by 180∘, so arctan(y∕x) cannot determine the
quadrant. The two-argument atan2 preserves the signs of both inputs and returns the correct
quadrant.
- Derive the 3-2-1 middle-angle formula.
From
we obtain
On the principal Tait Bryan branch,
so
Therefore
Also,
Hence
- Derive 3-2-1 yaw and roll extraction.
Away from the singularity, cos 𝜃≠0.
For yaw,
The common positive factor c𝜃 cancels in the two-argument inverse, giving
For roll,
so
Thus the complete nonsingular principal extraction is
- Numerical 3-2-1 extraction.
Yaw:
Pitch:
Roll:
Therefore
- Reconstruction check for 3-2-1.
The reconstructed matrix is
Numerically,
Thus C matches the supplied C to the shown precision.
A small reconstruction residual strongly suggests that the extraction formula, sequence,
signs, branch, and matrix convention are mutually consistent.
A large residual can reveal, among other things:
- the wrong Euler sequence;
- active/passive transpose confusion;
- wrong map direction;
- a sign error in an elementary rotation matrix;
- swapped first and third angles;
- an invalid input DCM.
- Active/passive transpose trap.
The PhysicsLibrary formulas assume the passive map
For the same orientation geometry, the corresponding active matrix is
Transposition changes the matrix elements used by the sequence-specific inverse formulas.
Applying passive extraction to the active matrix is therefore solving a different inverse
problem.
The returned numbers may still look smooth and physically plausible because the transpose
is itself a valid rotation matrix. Plausibility is not a convention check. Reconstruction with
the intended passive product is the appropriate diagnostic.
- Derive the 3-1-3 middle-angle formula.
From
we have
On the proper Euler principal branch
so
Therefore
Since
the robust middle-angle formula is
- Derive 3-1-3 outer-angle extraction.
Away from sin β = 0,
Hence
Also,
so
- Numerical 3-1-3 extraction.
First,
Then,
Finally,
Therefore
- Tait Bryan principal branch.
For
the cosine is nonnegative:
Therefore
throughout the principal branch.
The singular endpoints are
where cos β = 0 and the two outer rotations lose independent observability.
- Proper Euler principal branch.
For
we have
Thus
The singular endpoints are
At both endpoints the first and third physical rotation axes become collinear.
- 3-2-1 singularity at positive ninety degrees.
For
the singular DCM contains only the coupled outer-angle combination
Indeed the relevant matrix elements are
The chosen gauge gives
Therefore the software may report
This differs from the original coordinate triple but represents the same DCM. At the
singularity, ψ and ϕ are not independently observable.
- 3-2-1 singularity at negative ninety degrees.
At
the observable combination for this convention is
With
the coupled value is
The DCM gives approximately
Hence
Under the ϕ = 0 gauge the reported triple is therefore
- 3-1-3 singularity at beta equals zero.
At β = 0,
Thus only
is observable.
The matrix has
Therefore
If the policy chooses γ = 0, then it reports
- 3-1-3 singularity at beta equals pi.
At β = π, the full matrix depends on the outer angles only through
The upper-left pair becomes
Hence
With the policy γ = 0,
The numerical formula happens to look the same as at β = 0, but the underlying observable
combination is different: sum at one endpoint, difference at the other.
- Normalize, do not blindly modulo every angle.
An outer Euler Angle is ordinarily periodic modulo 2π, so a value such as
may be wrapped to
The middle Euler angle is different because the selected Euler chart imposes a restricted
principal interval.
For Tait Bryan sequences,
while for proper Euler sequences,
Moving the middle angle outside those ranges generally requires a coordinated change in the
two outer angles to preserve the same orientation.
Therefore a robust implementation should normalize the Euler triple to the selected principal
branch, not apply an independent modulo-2π operation to every coordinate.
- Alternate 3-2-1 branch.
The first triple is
The alternate Tait Bryan branch rule is
Applying it gives
Substituting either triple into
produces the same matrix.
The first triple lies on the usual principal branch because
The second does not. DCM-to-Euler extraction therefore requires a branch choice even away
from singularity.
- A non-3-2-1 Tait Bryan example.
For 1-3-2,
The middle angle is
The third angle is
Therefore
This example demonstrates why the 3-2-1 matrix-element pattern cannot simply be reused
for another Tait Bryan sequence.
- A non-3-1-3 proper Euler example.
For 2-3-2,
The middle angle is
The third angle is
Thus
Again, the DCM elements used by the inverse map are sequence specific.
- Near-singular conditioning.
For
For
The ratio is
Thus the common outer-angle scale factor is about 286 times smaller at 89.9∘ than at
60∘.
This explains why small perturbations in DCM elements can produce large changes in the
recovered outer angles near a Tait Bryan singularity even before the singularity is reached
exactly.
- Relative attitude and final implementation audit.
The two Euler triples are coordinates of two separate rotations. Euler coordinates do not
obey finite vector subtraction.
The exact passive relative map is
Using
and
one obtains approximately
Extracting intrinsic passive 3-2-1 angles gives approximately
and
Simple componentwise subtraction would have produced
which is close in two components for this particular example but is not the exact finite
relative orientation.
A production DCM-to-Euler implementation should include checks such as:
- explicit passive/active convention identification;
- explicit DCM map direction;
- explicit Euler sequence selection;
- orthogonality residual check;
- determinant check;
- appropriate DCM repair or rejection policy;
- sequence-specific singularity detection;
- documented singular gauge policy;
- principal-branch normalization;
- outer-angle wrapping convention;
- reconstruction of C;
- reconstruction residual test;
- tests near and exactly at singular configurations;
- regression tests for multiple Euler sequences.
5 Further study
The parent article Euler angles: direction cosine matrix to Euler angles contains the full extraction
tables for all twelve standard intrinsic Euler sequences and develops the numerical workflow in
detail.
The next article in the Euler series develops singularities, gimbal lock, and nonuniqueness as
geometric properties of Euler coordinate charts rather than failures of the underlying physical
attitude.
For numerical state propagation, a DCM or quaternion is generally preferable to an Euler triple.
Euler angles are especially useful as human-readable derived outputs when the selected chart
remains well conditioned.
6 References and further reading
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] J. K. Moore, Learn Multibody Dynamics, chapters “Orientation of Reference Frames”
and “Angular Kinematics.” Licensed CC BY 4.0. Learn Multibody Dynamics
[3] J. Diebel, “Representing Attitude: Euler Angles, Unit Quaternions, and Rotation
Vectors,” Stanford University, 2006. Online PDF
License
Unless otherwise noted, this PhysicsLibrary entry is intended for release under the Creative
Commons Attribution ShareAlike 4.0 International license.
"example of Euler angles: direction cosine matrix to Euler angles" is owned by bloftin.(view preamble)
|
|
| Keywords: |
Euler angles, direction cosine matrix, DCM, inverse Euler transformation, 3-2-1, 3-1-3, passive transformation, intrinsic rotation, atan2, principal branch, gimbal lock, singularity, reconstruction check, examples, exercises, worked solutions |
This object's parent.
Cross-references: quaternion, detection, Tait Bryan sequence, Euler Angle, operation, relative attitude, observable, formula, determinant, norms, dot product, vector, direction cosine matrix, matrix, Tait Bryan sequences, direction cosine matrix to Euler angles, Euler Angles
This is version 1 of example of Euler angles: direction cosine matrix to Euler angles, born on 2026-08-31.
Object id is 1137, canonical name is ExampleOfEulerAnglesDirectionCosineMatrixToEulerAngles.
Accessed 7 times total.
Classification:
|
|
|
|
|
|
|
|
Pending Errata and Addenda
|
|
|
|
|
|
|
|
|
|
|