3.5.10 · D5Guidance, Navigation & Control (GNC)

Question bank — Converting between DCM, quaternions, Euler angles

1,721 words8 min readBack to topic

These are concept traps, not calculators. Each line is a claim, an error, a "why", or an edge case. Cover the answer, commit out loud, then reveal. If your reason is "yes/no", you haven't answered — the justification is the point.

Parent: 3.5.10 · Converting between DCM, quaternions, Euler angles. Prerequisites worth re-opening: Euler's Rotation Theorem, Direction Cosine Matrix Properties, Gimbal Lock, Rotation Sequences (3-2-1 vs 3-1-3).


Notation you need before the traps

Every trap on this page assumes the body-from-inertial convention and the 3-2-1 sequence unless a line says otherwise. The picture below pins the three languages to one geometric rotation so the traps have something to point at.

Figure — Converting between DCM, quaternions, Euler angles

True or false — justify

A rotation matrix and its transpose describe the same physical orientation.
False. and are inverse rotations (body-from-inertial vs inertial-from-body). They only coincide for the identity or a turn; otherwise feeding the wrong one reverses every mapping. See Direction Cosine Matrix Properties.
The quaternions and point along opposite axes, so they are opposite rotations.
False. The rotation map is quadratic in , so the two minus signs cancel and both give the identical DCM — same axis, same angle. Negating is , which is no change. (See the double-cover figure.)
A matrix of nine real numbers can encode any rotation freely.
False. A DCM must be orthonormal with determinant : that's constraints, leaving only free numbers — the true dimension of rotation. Nine "free" numbers would allow shears and reflections.
Euler angles have a singularity because the physical rotation itself becomes undefined.
False. The rotation is perfectly fine; only the coordinate chart fails. At pitch two gimbal axes align so yaw and roll can't be separated — a flaw of the representation, not the motion. See Gimbal Lock and the gimbal figure below.
The quaternion set never has a singularity, so it can perfectly report human-readable attitude.
False (half-true). Quaternions are singularity-free for storing and propagating, but they are not human-readable — you still convert to Euler (which is singular) to report roll/pitch/yaw.
Because , a rotation of and a rotation of give the same quaternion.
False. gives ; gives . Same rotation, opposite quaternion — this is exactly the double cover.
The trace of a rotation matrix alone tells you the rotation angle.
True. , so . But it does not tell you the axis — you need the antisymmetric part for that.
Going quaternion → Euler → quaternion always returns the original quaternion.
False. Euler angles can't distinguish from , and near gimbal lock they lose information entirely; so the round trip may return or a nearby but different quaternion.

Spot the error

"To get Euler angles from a DCM I use ."
Uses plain , which only spans and drops both signs — a error whenever . Use , which keeps both signs and covers the full circle.
"DCM → quaternion: always , then ."
Breaks near rotations where and , so you divide by ~zero. Shepperd's fix: compute whichever of is largest first and divide by that.
"Since and are the same rotation, sign of never matters anywhere."
They give the same orientation, but for attitude interpolation and error signals the sign matters: choosing the wrong sign makes a slerp take the long path. Enforce for the shortest arc.
"I integrated the quaternion for a while; is now but that's fine, close enough."
Not fine. built from a non-unit is no longer orthonormal and will stretch/shear vectors. Renormalize every step. See Quaternion Kinematics & Propagation.
" and are the same rotation."
False — rotations don't commute, so the two orderings give different DCMs and different physical attitudes. The 3-2-1 sequence order is part of the definition. See Rotation Sequences (3-2-1 vs 3-1-3).
" in Rodrigues is symmetric because it comes from a cross product."
It's antisymmetric (); that's precisely why it supplies the (odd, direction-flipping) term while and supply the even terms. See Rodrigues Rotation Formula.
"To convert quaternion to Euler I'll just derive one big 12-term direct formula."
Error of practice, not algebra: the direct formula is error-prone. Route through the DCM as a neutral hub — quaternion → DCM → Euler — reusing two conversions you already trust.
"A pure rotation has since it's a big turn."
Backwards. for . The vector part carries all the magnitude there — which is exactly why the extraction branch fails.

Why questions

Why does the quaternion use the half angle and not ?
The rotating action multiplies by on both sides, effectively applying the turn twice; halving the stored angle cancels that doubling so the net rotation is exactly .
Why does beat for angle extraction?
Dividing throws away the individual signs, collapsing four quadrants into two. keeps both signs, resolving the full range with no ambiguity.
Why is the DCM called the "hub" for conversions?
Every representation has a clean, well-tested formula to and from the DCM, so composing two of those beats memorizing a dozen fragile direct formulas — fewer chances to flip a sign.
Why do we isolate the quaternion vector part from the antisymmetric part of ?
The symmetric part of mixes squares like , but the differences cleanly pick out cross terms — the vector components — free of the diagonal clutter.
Why does Euler's rotation theorem let us derive everything from axis–angle?
It guarantees any orientation is a single turn about one axis , so is a complete minimal description — DCM and quaternion are just two repackagings of it. See Euler's Rotation Theorem.
Why does the near- case specifically break the trace-based extraction?
At , so ; every other component is then computed by dividing by that vanishing , amplifying rounding error catastrophically.
Why does gimbal lock only cost you one degree of freedom, not two?
The pitch is still fully determined; only yaw and roll fuse into the single combination . So you lose one independent angle, not the whole attitude.
Why must you always state whether is body-from-inertial or inertial-from-body?
Because the two conventions are transposes/inverses of each other; an unstated convention silently reverses every rotation you apply and every attitude you report.

Edge cases

The identity rotation (): what is its quaternion and DCM?
and . The axis is undefined (nothing turns), which is harmless — any axis works because kills the vector part.
Rotation of exactly about , i.e. : which extraction branch do you use?
so ; switch to the largest diagonal, , giving , so .
Pitch (so ): what happens to yaw and roll extraction?
, so is undefined. By convention set and solve for the determined combination ; report the lost DOF. See Gimbal Lock.
A degenerate "axis" handed to the axis–angle formula: valid?
No — must be a unit vector. A zero axis has no direction; the only rotation with no meaningful axis is the identity, which you should represent directly as .
Very small rotation with a well-defined axis: is anything numerically fragile?
The rotation is fine, but recovering the axis from the tiny antisymmetric part of is noisy since those entries are near zero — a small-angle regime where quaternions integrate more stably. See Quaternion Kinematics & Propagation.
Feeding a slightly non-orthonormal (measurement noise) into DCM→quaternion: what breaks?
The trace/off-diagonal identities no longer hold exactly, so and may even take a square root of a negative number — orthonormalize first (e.g. via QUEST-style normalization).
Two different Euler triples reported for the same orientation — bug or expected?
Expected. Euler angles are periodic and non-unique (e.g. and , or the gimbal-lock fusion), so distinct triples can name one attitude. The DCM or normalized quaternion is the canonical arbiter.