80/20 core: To rotate a 3D vector v by a unit quaternion q, embed v as a
pure quaternion and compute v′=qvq−1. That's the whole game. Everything
else is understanding why the sandwich works and why it uses the half-angle.
We want the output v′=(0,v′) to still be a pure quaternion — otherwise
it wouldn't be a 3D vector. Take the conjugate of the product:
(qvq−1)∗=(q−1)∗v∗q∗.
For unit q: (q−1)∗=q and q∗=q−1. Also v∗=−v because v is pure.
So (qvq−1)∗=q(−v)q−1=−(qvq−1).
An object equal to −(its own conjugate) has zero scalar part ⇒ output is pure. ✓
Why this step? This proves the sandwich is closed on vectors. A one-sided
product qv would generally give a nonzero scalar — not a vector.
Take q=cos2θ+sin2θn^ with unit axis n^.
Split v=v∥+v⊥ (parallel/perpendicular to n^).
Parallel part (n^×v∥=0, n^⋅v∥=∣v∥∣):
Working the algebra, qv∥q−1=v∥ — the component
along the axis is unchanged (as a rotation about n^ should leave it). ✓
Perpendicular part: using n^⋅v⊥=0 and letting c=cos2θ,s=sin2θ,
qv⊥q−1=(c2−s2)v⊥+2cs(n^×v⊥).
Now the double-angle identities: c2−s2=cosθ and 2cs=sinθ. So
qv⊥q−1=cosθv⊥+sinθ(n^×v⊥).
That is exactly Rodrigues' rotation of v⊥ by angle θ about n^. ✓
Why the half-angle? Because q appears twice (once as q, once as q−1),
each contributing θ/2. The two half-angles combine via double-angle formulas
into a full θ. This is the #1 thing to remember.
Combining parallel + perpendicular gives the full Rodrigues formula:
v′=vcosθ+(n^×v)sinθ+n^(n^⋅v)(1−cosθ).
So qvq−1is Rodrigues in disguise — the same rotation, cheaper storage.
In the Hamilton product, where do dot and cross products come from?
Dot from same-axis terms (i2=−1); cross from cross-axis terms (ij=k).
Recall Feynman: explain to a 12-year-old
Imagine a spinning globe. To spin a dot on the globe, you need a "spin instruction."
A quaternion is a compact spin instruction: it stores an axis to spin around and
how much to spin. The trick is you "wrap" your dot in the instruction, spin, then
"unwrap" — that's the q…q−1 sandwich. And because you use the instruction twice
(wrap and unwrap), you only store half the turn amount inside it. Do that, and the dot
lands exactly where a full turn about that axis puts it.
Dekho, quaternion se vector rotate karna basically ek "sandwich" trick hai. Tumhare paas
ek vector v hai jise ek axis ke around θ angle se ghumana hai. Pehle vector ko ek
pure quaternion bana do — matlab scalar part zero, vector part v: (0,v). Phir formula
seedha hai: v′=qvq−1. Yahan q left mein, aur uska inverse (unit quaternion ke liye
inverse = conjugate, sirf vector part ka sign flip) right mein. Yeh sandwich zaroori hai warna
output pure quaternion nahi rahega, aur tumhe ek proper 3D vector nahi milega.
Sabse important baat: quaternion ke andar half angle hota hai, q=(cos2θ,sin2θn^).
Kyun? Kyunki q formula mein do baar aata hai — ek baar q, ek baar q−1. Har ek θ/2
deta hai, aur double-angle identity se cos2−sin2=cosθ, 2sincos=sinθ ban ke
full θ ho jata hai. Isliye agar tum 90∘ ghumana chahte ho to andar 45∘ dalna hoga.
Yeh galti students bahut karte hain, so yaad rakho.
GNC (satellite, drone attitude control) mein quaternion isliye favourite hai kyunki rotation
matrix ke 9 numbers ke bajaye sirf 4 numbers chahiye, gimbal lock ka problem nahi, aur
interpolation (SLERP) smooth hota hai. Aur ek cool baat: q aur −q dono same rotation dete hain
(double cover), kyunki signs sandwich mein cancel ho jate hain. Bas yaad rakho — "sandwich the
vector, halve the angle" — aur tumhara concept clear hai.