Shuru karne se pehle, ek picture jo poori game tumhare dimag mein fix kar de. Ek unit quaternion ek aisa point hai jo 4-dimensional space mein centre se bilkul ek unit door baithta hai — yeh ek aisi sphere par rehta hai jise hum poori tarah draw nahi kar sakte, isliye hum uska ek slice draw karte hain.
Blue circle dekho: yeh unit 3-sphere S3 ki 2D shadow hai. Yellow dot ek valid rotation quaternion hai (yeh circle par baitha hai). Red dot drift ho gaya hai — uske chaar squares ab 1 mein add nahi hote, isliye yeh rotation nahi hai jab tak hum ise renormalize nahi karte (red arrow use snap back karta hai).
Ab tum angle aur axis se quaternions build karte ho, half-angle rule use karke.
Recall Solution 2.1
Formula:q=(cos2θ,n^sin2θ). Half-angle isliye use hota hai kyunki vector ko rotate karna q ko do baar sandwich qvq−1 mein apply karta hai.
Half-angle: 260∘=30∘, toh 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
q=(cos2θ,n^sin2θ) se match karo.
Scalar: cos2θ=0.7071=22 ⇒ 2θ=45∘ ⇒ θ=90∘.
Vector part =(0.7071,0,0), aur uski length sin2θ=sin45∘=0.7071 ke barabar honi chahiye. Hai bhi. Toh unit axis hai n^=(1,0,0), x-axis.
Yeh x ke baare mein 90∘ rotation hai. (General mein reverse conversion ke liye Axis-Angle Representation dekho.)
Quaternions ko todho: conjugates, inverses, aur non-commuting product.
Recall Solution 3.1
Kyunki q ek unit quaternion hai, ∥q∥=1, isliye q−1=q∗=(q0,−qv) — bas vector signs flip karo:
q−1=(0.8660,0,−0.5,0).Kyun yeh conjugate hona chahiye:q⊗q∗=(q02+∣qv∣2,0)=(∥q∥2,0)=(1,0) exactly tab jab norm 1 ho. +y ke baare mein 60∘ rotation ko undo karna −y ke baare mein 60∘ rotation hai, jo y-component ko negate karne se yahi keh raha hai. ✔
Recall Solution 3.2
Hamilton product: p⊗q=(p0q0−p⋅q,p0q+q0p+p×q).
Yahan 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.
Ab swap karo. Cross product sign flip karta hai: q×p=(0,0,−1).
q⊗p=(0,0,0,−1)=−k.
Yeh sign se alag hain — ij=k lekin ji=−k ki seedhi picture. p×q term exactly isliye hai kyun rotations bhi commute nahi karte.
Kayi ideas ek saath combine karo: rotations compose karna, double cover, aur ek chain mein renormalization.
Recall Solution 4.1
Step 1 — har factor banao (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 productp=q2, q=q1 ke saath. Maano c=22, toh 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).
Vector parts ka sum: (21,−21,21).
q2⊗q1=(21,21,−21,21).Step 3 — sanity check norm:4×(21)2=4×41=1 ✔. Composed object ab bhi ek valid unit quaternion hai, isliye yeh ek legal single rotation hai — Euler angles chain karne ke mukable yeh ek bada advantage hai (Euler Angles and Gimbal Lock).
Recall Solution 4.2
Dono ka ∑qi2=4×0.25=1 ✔, toh dono unit quaternions hain.
q ke liye: cos2θ=0.5⇒2θ=60∘⇒θ=120∘ axis n^∝(0.5,−0.5,0.5) ke baare mein, yaani n^=31(1,−1,1).
−q ke liye: cos2θ=−0.5⇒2θ=120∘⇒θ=240∘ axis ∝(−0.5,0.5,−0.5)=−31(1,−1,1) ke baare mein.
−n^ ke baare mein 240∘ ka turn wahi hai jo +n^ ke baare mein 120∘ ka turn hai (ulti direction mein lambe raaste se jaana tumhe usi jagah pahunchata hai). Sandwich mein, do minus signs cancel ho jaate hain: (−q)v(−q)−1=qvq−1. Same physical rotation. Yahi S3→SO(3)double cover hai.
Exactly wahi karo jo ek flight computer har timestep karta hai: integrate karo, drift karo, aur repair karo.
Recall Solution 5.1
(a) Squares ka sum: 0.99452+0.05232+0.06982+0.03492=0.989030+0.002735+0.004872+0.001218=0.997855.
∥q∥=0.997855≈0.998927.
(b) Har component ko norm se divide karo:
q←∥q∥q≈(0.99557,0.05236,0.06987,0.03494).
Naya squares ka sum =1 by construction ✔.
(c) Discrete integration rounding error accumulate karta hai, isliye q dheere dheere unit sphere se bahar jaata hai; norm se divide karna ise seedha S3 par wapas project karta hai, aur ise ek valid rotation rakhta hai agले Rotation Matrices SO(3) conversion ke liye jo guidance loop ko chahiye.
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 ✔ (ek "pure" quaternion, scalar part 0, kyunki 180∘ turns mein hamesha cos90∘=0 hota hai).
(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 ✔.
180∘ ki ek curiosity note karo: yahan q=(0,qv) aur −q=(0,−qv)=q∗=q−1, toh yeh rotation apna khud ka inverse hai — 180∘ do baar ghumane se tum wapas aa jaate ho.