Intuition What this page is
The parent note showed you what a quaternion is and why the unit constraint = 1. Here we do the opposite: we throw every kind of input at the formula q = ( cos 2 θ , n ^ sin 2 θ ) and its friends (product ⊗ , conjugate, sandwich rotation) and grind each one to a number you can check by hand. Nothing here is abstract — every example ends in a Verify line.
Before we start, one reminder of the tools we lean on (all built in the parent — we never use a symbol we did not earn there):
Recall The three tools we reuse
Encoding: q = ( cos 2 θ , n ^ sin 2 θ ) — angle θ about unit axis n ^ .
Product: p ⊗ q = ( p 0 q 0 − p ⋅ q , p 0 q + q 0 p + p × q ) .
Sandwich rotation of a vector v : treat v as a pure quaternion v = ( 0 , v ) , then v ′ = q ⊗ v ⊗ q − 1 , and for a unit q , q − 1 = q ∗ = ( q 0 , − q v ) .
Every situation this topic can hand you falls into one of these cells . Each worked example below is tagged with the cell it kills.
Cell
Scenario class
What could trip you up
A
Zero / degenerate: θ = 0
axis is undefined, must still give identity
B
Positive angle, clean axis (Q-I style)
half-angle, norm check
C
Negative angle / opposite spin
which sign flips, q vs q − 1
D
Limiting value: θ = 18 0 ∘
cos 9 0 ∘ = 0 , scalar part vanishes
E
Non-commutativity: p ⊗ q vs q ⊗ p
the p × q term
F
Double cover: q vs − q
same rotation, different tuple
G
Actually rotate a vector (sandwich)
does the arrow really move?
H
Drift & renormalize (numerical)
project back to S 3
I
Real-world word problem (spacecraft)
translate words → axis + angle
J
Exam twist: recover θ , n ^ from a given q
inverting cos/sin, arccos, unit axis
θ = 0 (identity)
Encode "rotate by 0 ∘ about any axis n ^ ".
Forecast: guess the four numbers before reading on. (Hint: doing nothing should behave like multiplying by 1.)
Half-angle: θ /2 = 0 .
Why this step? Every quaternion formula uses θ /2 , never θ (double-sided product). So we always halve first.
Scalar part: cos 0 = 1 .
Vector part: n ^ sin 0 = n ^ ⋅ 0 = ( 0 , 0 , 0 ) .
Why this step? sin 0 = 0 kills the axis entirely — that is why a zero rotation doesn't care which axis you pick. The degeneracy is harmless.
So q = ( 1 , 0 , 0 , 0 ) .
Verify: norm2 = 1 2 + 0 + 0 + 0 = 1 ✔. And q ⊗ q = ( 1 ⋅ 1 − 0 ⋅ 0 , … ) = ( 1 , 0 ) , so it acts like 1 . ✔
9 0 ∘ about the z -axis
Axis n ^ = ( 0 , 0 , 1 ) , angle θ = 9 0 ∘ .
Forecast: which of the four slots will be non-zero, and will they be 2 2 or 2 1 ?
Half-angle: θ /2 = 4 5 ∘ .
Scalar: cos 4 5 ∘ = 2 2 ≈ 0.7071 .
Vector: n ^ sin 4 5 ∘ = ( 0 , 0 , 1 ) ⋅ 2 2 = ( 0 , 0 , 2 2 ) .
Why this step? Only the z -slot (q 3 ) gets the sine because the axis points purely along z ; q 1 , q 2 stay 0 .
q = ( 2 2 , 0 , 0 , 2 2 ) .
Verify: ( 2 2 ) 2 + ( 2 2 ) 2 = 2 1 + 2 1 = 1 ✔.
Look at the figure: the teal axis is z , and the quaternion parks the angle 4 5 ∘ (half of the real 9 0 ∘ , in plum ) into the scalar slot. The full 9 0 ∘ physical turn (burnt orange arc) is what the sandwich will actually produce on a vector — we do that in Cell G.
− 9 0 ∘ about z , and how it relates to + 9 0 ∘
Same axis n ^ = ( 0 , 0 , 1 ) but θ = − 9 0 ∘ .
Forecast: which slot changes sign compared to Cell B?
Half-angle: − 4 5 ∘ .
Scalar: cos ( − 4 5 ∘ ) = cos 4 5 ∘ = 2 2 (cosine is even — unchanged).
Why this step? Reversing the spin does not flip the scalar; that is why q 0 tells you the amount of turn, not its direction.
Vector: n ^ sin ( − 4 5 ∘ ) = ( 0 , 0 , − 2 2 ) (sine is odd — sign flips).
q − = ( 2 2 , 0 , 0 , − 2 2 ) .
Verify — is this the inverse of Cell B? The unit inverse is the conjugate: q B ∗ = ( 2 2 , 0 , 0 , − 2 2 ) = q − ✔. So rotating by − θ = conjugating — exactly what "undo the rotation" should mean. Also q B ⊗ q − should be identity: scalar part = 2 1 − ( 0 , 0 , 2 2 ) ⋅ ( 0 , 0 , − 2 2 ) = 2 1 + 2 1 = 1 , vector part = 0 ✔.
Worked example D · half-turn about
x
Axis n ^ = ( 1 , 0 , 0 ) , θ = 18 0 ∘ .
Forecast: what happens to the scalar part when the turn is a full half-circle?
Half-angle: 9 0 ∘ .
Scalar: cos 9 0 ∘ = 0 .
Why this step? This is the limiting behaviour — the scalar part vanishes completely , leaving a pure quaternion. Half-turns are the only rotations with q 0 = 0 .
Vector: n ^ sin 9 0 ∘ = ( 1 , 0 , 0 ) ⋅ 1 = ( 1 , 0 , 0 ) .
q = ( 0 , 1 , 0 , 0 ) .
Verify: norm2 = 0 + 1 + 0 + 0 = 1 ✔. Sanity: q ⊗ q should be a 36 0 ∘ turn = − identity (double cover!). Scalar of q ⊗ q = 0 ⋅ 0 − ( 1 , 0 , 0 ) ⋅ ( 1 , 0 , 0 ) = − 1 , vector = 0 , so q ⊗ q = ( − 1 , 0 ) = − q id ✔ — the famous "two half-turns give − 1 , not + 1 ."
p ⊗ q = q ⊗ p
Let p = ( 0 , 1 , 0 , 0 ) (Cell-D style, 18 0 ∘ about x ) and q = ( 0 , 0 , 1 , 0 ) (18 0 ∘ about y ).
Forecast: will the scalar parts match but the vectors differ? Or something else?
Compute p ⊗ q . Scalars: p 0 q 0 = 0 ; p ⋅ q = ( 1 , 0 , 0 ) ⋅ ( 0 , 1 , 0 ) = 0 . Scalar part = 0 .
Vector part = p 0 q + q 0 p + p × q = 0 + 0 + ( 1 , 0 , 0 ) × ( 0 , 1 , 0 ) = ( 0 , 0 , 1 ) .
Why this step? With both scalars zero, only the cross product survives — this is the term that carries the "order matters" information.
So p ⊗ q = ( 0 , 0 , 0 , 1 ) .
Now swap: q ⊗ p vector part = ( 0 , 1 , 0 ) × ( 1 , 0 , 0 ) = ( 0 , 0 , − 1 ) , giving q ⊗ p = ( 0 , 0 , 0 , − 1 ) .
Verify: p ⊗ q = ( 0 , 0 , 0 , 1 ) = ( 0 , 0 , 0 , − 1 ) = q ⊗ p ✔. They differ by a sign in q 3 — precisely because p × q = − ( q × p ) . Rotations don't commute, and the cross product is why .
Worked example F · same rotation, two tuples
Take q B = ( 2 2 , 0 , 0 , 2 2 ) from Cell B and − q B = ( − 2 2 , 0 , 0 , − 2 2 ) .
Forecast: do they rotate a vector the same way or opposite ways?
In the sandwich v ′ = q ⊗ v ⊗ q − 1 , replace q → − q .
Then ( − q ) ⊗ v ⊗ ( − q ) − 1 . But ( − q ) − 1 = ∥ q ∥ 2 ( − q ) ∗ = − q − 1 .
Why this step? Conjugation flips the vector part but − 1 multiplies through, so the inverse also picks up a − 1 .
So ( − 1 ) ⋅ ( − 1 ) = + 1 : the two minus signs cancel , giving exactly q ⊗ v ⊗ q − 1 .
Verify: norm of both is 1 (check: ( − 2 2 ) 2 + ( − 2 2 ) 2 = 1 ✔) and they produce identical vectors. Same physical 9 0 ∘ turn, two names. This is the S 3 → S O ( 3 ) double cover.
Worked example G · turn the point
( 1 , 0 , 0 ) by 9 0 ∘ about z
Use q = ( 2 2 , 0 , 0 , 2 2 ) (Cell B). Vector v = ( 1 , 0 , 0 ) , written as pure quaternion v = ( 0 , 1 , 0 , 0 ) .
Forecast: a 9 0 ∘ turn about z should send the x -arrow onto the y -arrow . Predict v ′ before computing.
First product t = q ⊗ v . Scalar = q 0 ⋅ 0 − ( 0 , 0 , 2 2 ) ⋅ ( 1 , 0 , 0 ) = 0 . Vector = q 0 ( 1 , 0 , 0 ) + 0 ⋅ q v + ( 0 , 0 , 2 2 ) × ( 1 , 0 , 0 ) .
q 0 ( 1 , 0 , 0 ) = ( 2 2 , 0 , 0 ) .
cross = ( 0 , 0 , 2 2 ) × ( 1 , 0 , 0 ) = ( 0 , 2 2 , 0 ) .
So t = ( 0 , 2 2 , 2 2 , 0 ) .
Why this step? We build the sandwich left-to-right; t is a temporary, not the answer.
Second product v ′ = t ⊗ q − 1 , with q − 1 = q ∗ = ( 2 2 , 0 , 0 , − 2 2 ) .
Scalar = t 0 q 0 − 1 − t ⋅ q − 1 = 0 − ( 2 2 , 2 2 , 0 ) ⋅ ( 0 , 0 , − 2 2 ) = 0 .
Vector = t 0 q − 1 + q 0 − 1 t + t × q − 1
= 0 + 2 2 ( 2 2 , 2 2 , 0 ) + ( 2 2 , 2 2 , 0 ) × ( 0 , 0 , − 2 2 ) .
middle term = ( 2 1 , 2 1 , 0 ) .
cross = ( 2 2 , 2 2 , 0 ) × ( 0 , 0 , − 2 2 ) = ( − 2 1 , 2 1 , 0 ) .
sum = ( 0 , 1 , 0 ) .
So v ′ = ( 0 , 0 , 1 , 0 ) , i.e. the vector ( 0 , 1 , 0 ) .
Verify: the x -arrow ( 1 , 0 , 0 ) became the y -arrow ( 0 , 1 , 0 ) — exactly a + 9 0 ∘ turn about z ✔. Length preserved: 0 2 + 1 2 + 0 2 = 1 ✔ (rotations never stretch). Scalar part stayed 0 , so v ′ is still a pure quaternion ✔.
The figure shows the input arrow (burnt orange, along x ) swinging up to the output arrow (teal, along y ), with the 9 0 ∘ arc in plum. The sandwich did what geometry demanded.
Worked example H · integrator gives a slightly-off quaternion
After a timestep the propagator returns q = ( 0.9 , 0.1 , 0.2 , 0.3 ) .
Forecast: is its norm above or below 1 ? By roughly how much?
Norm2 : 0.81 + 0.01 + 0.04 + 0.09 = 0.95 .
Norm: 0.95 ≈ 0.97468 .
Why this step? 0.95 < 1 means the tuple drifted inside the unit 3-sphere S 3 ; it no longer encodes a valid rotation.
Project back: divide each component by the norm:
q ← 0.97468 q = ( 0.92338 , 0.10260 , 0.20520 , 0.30780 ) .
Why this step? Scaling all four by the same factor keeps the direction in 4D (same rotation) but pushes the point onto the sphere surface.
Verify: new norm2 = 0.9233 8 2 + 0.1026 0 2 + 0.2052 0 2 + 0.3078 0 2 = 1.0000 ✔ (to 4 dp). Cheap fix, done every control cycle.
Worked example I · spacecraft slew command
Mission control says: "Slew the telescope 12 0 ∘ about the body axis n ^ = 3 1 ( 1 , 1 , 1 ) ." Build the command quaternion.
Forecast: the axis is already unit (check!) — so which numbers land in the vector slots?
Confirm unit axis: ( 3 1 ) 2 ⋅ 3 = 3 1 ⋅ 3 = 1 ✔. Good, encoding requires a unit axis.
Half-angle: 12 0 ∘ /2 = 6 0 ∘ .
Scalar: cos 6 0 ∘ = 0.5 .
Vector: n ^ sin 6 0 ∘ = 3 1 ( 1 , 1 , 1 ) ⋅ 2 3 .
Note 3 1 ⋅ 2 3 = 2 1 , so vector = ( 2 1 , 2 1 , 2 1 ) = ( 0.5 , 0.5 , 0.5 ) .
Why this step? The 3 's cancel beautifully — a 12 0 ∘ turn about the diagonal gives the clean quaternion ( 2 1 , 2 1 , 2 1 , 2 1 ) , a famous one (it cyclically permutes the axes x → y → z ).
Command q = ( 0.5 , 0.5 , 0.5 , 0.5 ) .
Verify: norm2 = 0.25 ⋅ 4 = 1 ✔. Applying it twice (q ⊗ q , a 24 0 ∘ turn) should still be unit and its scalar = 0.25 − ( 0.5 , 0.5 , 0.5 ) ⋅ ( 0.5 , 0.5 , 0.5 ) = 0.25 − 0.75 = − 0.5 — consistent with cos 12 0 ∘ = − 0.5 ✔.
Worked example J · read the rotation back out
Given q = ( 0.5 , 0.5 , 0.5 , 0.5 ) (Cell I's answer, but pretend you don't know its origin). Recover the angle θ and axis n ^ .
Forecast: the scalar is 0.5 = cos ( something ) — what angle, and remember to double it.
Angle from scalar: q 0 = cos 2 θ = 0.5 ⇒ 2 θ = arccos ( 0.5 ) = 6 0 ∘ ⇒ θ = 12 0 ∘ .
Why this step? arccos undoes cosine — it answers "which half-angle has this cosine?" We then multiply by 2 to recover the true turn.
Axis from vector: n ^ = sin ( θ /2 ) q v = sin 6 0 ∘ ( 0.5 , 0.5 , 0.5 ) = 0.86603 ( 0.5 , 0.5 , 0.5 ) = ( 0.57735 , 0.57735 , 0.57735 ) .
Why this step? The vector slot is n ^ sin 2 θ , so dividing by sin 2 θ strips off the length and leaves the pure unit axis = 3 1 ( 1 , 1 , 1 ) .
Degenerate warning: if q 0 = ± 1 then sin 2 θ = 0 and step 2 divides by zero — that's the identity (Cell A), where the axis is genuinely undefined. Detect it before dividing.
Verify: recovered θ = 12 0 ∘ ✔ and n ^ = ( 0.57735 , … ) with norm2 = 3 ⋅ 0.5773 5 2 = 1.0000 ✔ — a unit axis, exactly matching Cell I's input.
Recall Cell D: what is special about the scalar part of a
18 0 ∘ rotation?
cos 9 0 ∘ = 0 , so q 0 = 0 — it's a pure quaternion.
Recall Cell J: how do you get
θ back from a quaternion?
θ = 2 arccos ( q 0 ) , then n ^ = q v / sin 2 θ (watch the q 0 = ± 1 division-by-zero).
Recall Cell E: which term makes
p ⊗ q = q ⊗ p ?
The cross product p × q , which flips sign on swap.
Related build-outs: Axis-Angle Representation , Quaternion Kinematics — dq/dt , Rotation Matrices SO(3) , Euler Angles and Gimbal Lock , Spacecraft Attitude Determination , Complex Numbers as 2D Rotations .
Recover angle from a unit quaternion. θ = 2 arccos ( q 0 ) .
Recover the axis from a unit quaternion. n ^ = q v / sin ( θ /2 ) (undefined when
q 0 = ± 1 ).
Quaternion for 12 0 ∘ about 3 1 ( 1 , 1 , 1 ) . ( 0.5 , 0.5 , 0.5 , 0.5 ) .
Why does q 0 = 0 mean a half-turn? cos ( θ /2 ) = 0 ⇒ θ /2 = 9 0 ∘ ⇒ θ = 18 0 ∘ .