3.5.6 · D4Guidance, Navigation & Control (GNC)

Exercises — Quaternions — definition q = (q₀, q₁, q₂, q₃), unit quaternion constraint

2,166 words10 min readBack to topic

Before we start, one picture to fix the whole game in your head. A unit quaternion is a point sitting exactly one unit away from the centre in a 4-dimensional space — it lives on a sphere we cannot fully draw, so we draw a slice of it.

Figure — Quaternions — definition q = (q₀, q₁, q₂, q₃), unit quaternion constraint

Look at the blue circle: it is the 2D shadow of the unit 3-sphere . The yellow dot is a valid rotation quaternion (it sits on the circle). The red dot has drifted off — its four squares no longer add to , so it is not a rotation until we renormalize it (the red arrow snaps it back).


L1 — Recognition

These test whether you can read a quaternion and check the one law it must obey.

Recall Solution 1.1

The test is the unit constraint: . Compute each sum of squares.

  • (a) valid ✔ (this is the identity, "do nothing").
  • (b) valid ✔.
  • (c) valid ✔.
  • (d) not valid ✗ (norm is , must be normalized first).
Recall Solution 1.2
  • Scalar part = (the "how much twist" piece).
  • Vector part (the "which axis" piece).
  • Conjugate flips only the vector part: .

L2 — Application

Now you build quaternions from an angle and axis, using the half-angle rule.

Recall Solution 2.1

Formula: . The half-angle is used because rotating a vector applies twice in the sandwich . Half-angle: , so , . Norm check: ✔.

Recall Solution 2.2

Match to .

  • Scalar: .
  • Vector part , and its length must equal . It does. So the unit axis is , the -axis. This is a rotation about . (See Axis-Angle Representation for the reverse conversion in general.)

L3 — Analysis

Take quaternions apart: conjugates, inverses, and the non-commuting product.

Recall Solution 3.1

Since is a unit quaternion, , so — just flip the vector signs: Why it must be the conjugate: exactly when the norm is . Undoing a rotation about is a rotation about , which is what negating the -component says. ✔

Recall Solution 3.2

Hamilton product: . Here , , .

  • Scalar: .
  • Vector: . Now swap. The cross product flips sign: . They differ by a sign — a direct picture of but . The term is exactly why rotations do not commute either.

L4 — Synthesis

Combine several ideas at once: composing rotations, the double cover, renormalization inside a chain.

Recall Solution 4.1

Step 1 — build each factor (half-angle, , ): Step 2 — Hamilton product with , . Let , so . , .

  • Scalar: .
  • .
  • .
  • . Sum the vector parts: . Step 3 — sanity check norm: ✔. The composed object is still a valid unit quaternion, so it is a legal single rotation — one of the great advantages over chaining Euler angles (Euler Angles and Gimbal Lock).
Recall Solution 4.2

Both have ✔, so both are unit quaternions. For : about axis , i.e. . For : about axis . A turn about is a turn about (going the long way round the opposite direction lands you at the same place). In the sandwich, the two minus signs cancel: . Same physical rotation. This is the double cover.


L5 — Mastery

Do exactly what a flight computer does each timestep: integrate, drift, and repair.

Recall Solution 5.1

(a) Sum of squares: . . (b) Divide each component by the norm: New sum of squares by construction ✔. (c) Discrete integration accumulates rounding error, so slowly leaves the unit sphere; dividing by the norm projects it straight back onto , keeping it a valid rotation for the next Rotation Matrices SO(3) conversion the guidance loop needs.

Recall Solution 5.2

(a) Half-angle : , . Norm: ✔ (a "pure" quaternion, scalar part , since turns always have ). (b) Unit ⇒ . (c) = identity ✔. Note a curiosity of : here and , so this rotation is its own inverse — turning twice returns you home.


Active Recall

Recall One-line: how do you test if

is a rotation quaternion? Check .

Recall One-line: given

and , write . — half the angle.

Recall One-line: inverse of a unit quaternion and why.

(flip vector part), because .