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.
Look at the blue circle: it is the 2D shadow of the unit 3-sphere S3. 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 1, so it is not a rotation until we renormalize it (the red arrow snaps it back).
Now you build quaternions from an angle and axis, using the half-angle rule.
Recall Solution 2.1
Formula:q=(cos2θ,n^sin2θ). The half-angle is used because rotating a vector applies qtwice in the sandwich qvq−1.
Half-angle: 260∘=30∘, so cos30∘=23≈0.8660, sin30∘=0.5.
q=(23,0,0.5,0)≈(0.8660,0,0.5,0).
Norm check: (23)2+0.52=0.75+0.25=1 ✔.
Recall Solution 2.2
Match to q=(cos2θ,n^sin2θ).
Scalar: cos2θ=0.7071=22 ⇒ 2θ=45∘ ⇒ θ=90∘.
Vector part =(0.7071,0,0), and its length must equal sin2θ=sin45∘=0.7071. It does. So the unit axis is n^=(1,0,0), the x-axis.
This is a 90∘ rotation about x. (See Axis-Angle Representation for the reverse conversion in general.)
Take quaternions apart: conjugates, inverses, and the non-commuting product.
Recall Solution 3.1
Since q is a unit quaternion, ∥q∥=1, so q−1=q∗=(q0,−qv) — just flip the vector signs:
q−1=(0.8660,0,−0.5,0).Why it must be the conjugate:q⊗q∗=(q02+∣qv∣2,0)=(∥q∥2,0)=(1,0) exactly when the norm is 1. Undoing a 60∘ rotation about +y is a 60∘ rotation about −y, which is what negating the y-component says. ✔
Recall Solution 3.2
Hamilton product: p⊗q=(p0q0−p⋅q,p0q+q0p+p×q).
Here p0=q0=0, p=(1,0,0), q=(0,1,0).
Scalar: 0−(p⋅q)=−(0)=0.
Vector: 0+0+p×q=(1,0,0)×(0,1,0)=(0,0,1).
p⊗q=(0,0,0,1)=k.
Now swap. The cross product flips sign: q×p=(0,0,−1).
q⊗p=(0,0,0,−1)=−k.
They differ by a sign — a direct picture of ij=k but ji=−k. The p×q term is exactly why rotations do not commute either.
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, 45∘, cos=sin=22≈0.7071):
q1=(22,0,0,22)(z-axis),q2=(22,22,0,0)(x-axis).Step 2 — Hamilton product with p=q2, q=q1. Let c=22, so c2=21.
p=(c,0,0), q=(0,0,c).
Scalar: p0q0−p⋅q=c⋅c−0=c2=21.
p0q=(0,0,c2)=(0,0,21).
q0p=(c2,0,0)=(21,0,0).
p×q=(c,0,0)×(0,0,c)=(0,−c2,0)=(0,−21,0).
Sum the vector parts: (21,−21,21).
q2⊗q1=(21,21,−21,21).Step 3 — sanity check norm:4×(21)2=4×41=1 ✔. 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 ∑qi2=4×0.25=1 ✔, so both are unit quaternions.
For q: cos2θ=0.5⇒2θ=60∘⇒θ=120∘ about axis n^∝(0.5,−0.5,0.5), i.e. n^=31(1,−1,1).
For −q: cos2θ=−0.5⇒2θ=120∘⇒θ=240∘ about axis ∝(−0.5,0.5,−0.5)=−31(1,−1,1).
A 240∘ turn about −n^is a 120∘ turn about +n^ (going the long way round the opposite direction lands you at the same place). In the sandwich, the two minus signs cancel: (−q)v(−q)−1=qvq−1. Same physical rotation. This is the S3→SO(3)double cover.
Do exactly what a flight computer does each timestep: integrate, drift, and repair.
Recall Solution 5.1
(a) Sum of squares: 0.99452+0.05232+0.06982+0.03492=0.989030+0.002735+0.004872+0.001218=0.997855.
∥q∥=0.997855≈0.998927.
(b) Divide each component by the norm:
q←∥q∥q≈(0.99557,0.05236,0.06987,0.03494).
New sum of squares =1 by construction ✔.
(c) Discrete integration accumulates rounding error, so q slowly leaves the unit sphere; dividing by the norm projects it straight back onto S3, keeping it a valid rotation for the next Rotation Matrices SO(3) conversion the guidance loop needs.
Recall Solution 5.2
(a) Half-angle 2180∘=90∘: cos90∘=0, sin90∘=1.
q=(0,n^⋅1)=(0,21,21,0)≈(0,0.7071,0.7071,0).
Norm: 0+21+21+0=1 ✔ (a "pure" quaternion, scalar part 0, since 180∘ turns always have cos90∘=0).
(b) Unit ⇒ q−1=q∗=(0,−21,−21,0).
(c)q⊗q−1=(q02+∣qv∣2,0)=(0+1,0)=(1,0,0,0) = identity ✔.
Note a curiosity of 180∘: here q=(0,qv) and −q=(0,−qv)=q∗=q−1, so this rotation is its own inverse — turning 180∘ twice returns you home.