Exercises — Converting between DCM, quaternions, Euler angles
3.5.10 · D4· Physics › Guidance, Navigation & Control (GNC) › DCM, quaternions, Euler angles ke beech convert karna
Ye parent topic ki practice arena hai. Har problem L1 → L5 tak graded hai. Pehle khud try karo, phir collapsible solution kholo. Saari machinery parent note mein hai: Rodrigues Rotation Formula, Direction Cosine Matrix Properties, Quaternion Kinematics & Propagation, Gimbal Lock, Rotation Sequences (3-2-1 vs 3-1-3).
Shuru karne se pehle, ek figure saare conventions aur symbols fix kar deta hai jo hum baar baar reuse karenge.

Level 1 — Recognition
L1.1 — Ek quaternion ka axis aur angle padhna
Quaternion diya gaya hai. Rotation axis aur turn angle kya hai?
Recall Solution — L1.1
KYA use karein: axis–angle definition aur . KYU DCM nahi balki ye: axis aur angle seedha quaternion mein directly bake in hote hain; koi matrix ki zaroorat nahi.
se milta hai , toh . Vector part equal hona chahiye ke. se divide karke: .
Jawab: axis (-axis), angle .
L1.2 — Trace shortcut ko pehchaanna
Kisi bhi rotation quaternion ke liye, uske DCM ka trace hota hai. diya gaya ho toh nikalo (positive root lete hue).
Recall Solution — L1.2
KYA/KYU: parent note prove karta hai . Ye ek scalar carry karta hai, isliye ye sabse fast handle hai. Sanity check: — L1.1 wale rotation se match karta hai.
Level 2 — Application
L2.1 — Quaternion → DCM (matrix banana)
ko uske DCM mein convert karo.
Recall Solution — L2.1
KYA: parent ke formula mein plug karo. KYU: vectors ko rotate karne ke liye matrix form chahiye. Yahan , toh , aur .
- ,
- baaki saare off-diagonals mein ya hain. Ye ke baare mein pure yaw hai (parent ka Example 1 dekho). ✓
L2.2 — Euler → DCM (3-2-1) ek single pitch ke liye
compute karo, yaani pure pitch , roll , yaw .
Recall Solution — L2.2
KYA: parent ke 3-2-1 matrix mein ke saath substitute karo (). KYU: confirm karta hai ki aap general formula se terms ko zero karke padh sakte ho. Middle row/column untouched hai kyunki hum ke around ghoom rahe hain: -axis fixed rehta hai. Ye geometric "look" hai.
L2.3 — DCM → Euler extraction
L2.2 ke matrix se, parent ke extraction rules use karke recover karo.
Recall Solution — L2.3
KYA/KYU: hum specific entries padhte hain kyunki woh ek ek angle ko isolate karte hain (parent "DCM → Euler").
- ✓
- ✓
- — lekin yahan hai, toh , jo deta hai ✓ Round trip exactly recover ho gaya. (Note: sirf tab truly undefined hota hai jab , yaani gimbal lock — yahan nahi.)
Level 3 — Analysis
L3.1 — DCM → Quaternion, safe branch
Diya gaya trace branch use karke recover karo, aur enforce karo.
Recall Solution — L3.1
KYA: pehle trace. , toh . KYU trace branch yahan safe hai: comfortably se door hai, toh se divide karna theek hai.
- Ye exactly L2.1 ka input hai — conversion ek perfect inverse hai. ✓
L3.2 — DCM → Quaternion, singular branch ( ke paas)
ke liye ( ke baare mein rotation), trace branch fail ho jaati hai. sahi se recover karo.
Recall Solution — L3.2
KYA: . se divide karna illegal hai — isliye Shepperd kehta hai sabse bade component se divide karo. KYU: par scalar part vanish ho jaata hai; sabse bada diagonal entry batata hai ki kaun sa vector component dominate karta hai. Diagonal entries hain ; sabse bada hai, toh solve karo: Phir off-diagonals baaki sab dete hain ke zariye, aur . Check: ; axis ✓.
L3.3 — Gimbal lock detect aur handle karna
Ek DCM mein hai. Dikhao ki ye gimbal lock hai, nikalo, aur explain karo ki kya (aur kya nahi) recoverable hai.
Recall Solution — L3.3
KYA: . KYU ye singularity hai: ke saath, , toh parent matrix mein aur . Tab undefined hai — yaw aur roll axes align ho gaye hain (dekho Gimbal Lock). Kya bachta hai: off-diagonal block collapse ho jaata hai jisse sirf sum determine hota hai ( ke liye), har ek alag nahi. Convention: set karo, phir ko se padho — woh combined angle fully valid hai; split ek free choice hai. Ek degree of freedom reported as lost ho jaata hai.
Level 4 — Synthesis
L4.1 — Full chain: Euler → DCM → quaternion
lo. banao, phir extract karo, aur "via-the-hub" workflow confirm karo.
Recall Solution — L4.1
KYU via DCM: seedha Euler→quaternion formula (12 terms) yaad karna error-prone hai; do trusted maps compose karo (parent Example: DCM ko neutral hub ki tarah use karo).
Step 1 (Euler→DCM): pure yaw . L2.2-style substitution sirf ke saath: Step 2 (DCM→quaternion): L3.1 ke identical → . Cross-check via axis–angle: ke baare mein yaw ⇒ , ✓. Hub route aur direct axis–angle route agree karte hain.
L4.2 — Do rotations compose karo, phir axis padho
yaw ( L4.1 se) ke baad ke baare mein roll () apply karo. Quaternions multiply karo () aur combined rotation ka report karo.
Recall Solution — L4.2
KYA/KYU: quaternion multiplication rotations ko cheaply compose karta hai (parent: quaternions propagation ke liye best hain). Hamilton product ke saath: , ke saath:
- ,
- Norm check: ✓. Angle: . Combined turn hai axis ke baare mein.
Level 5 — Mastery
L5.1 — Trace identity prove karo
Parent ke se shuru karke, unit-norm constraint use karke prove karo ki .
Recall Solution — L5.1
KYA: teen diagonal entries add karo. terms: ; similarly aur har ek net deta hai; net deta hai. Toh KYU constraint enter hoti hai: use karo:
L5.2 — par round-trip robustness
Dikhao ki ke liye (parent Example 2, ke baare mein ), recovered quaternion se rebuild karne par original matrix wapas milti hai — verify karta hai ki singular branch sirf ek hack nahi hai.
Recall Solution — L5.2
Step 1 — extract (sabse bada diagonal hai): aur , , milta hai . Step 2 — rebuild ke zariye , baaki ke saath:
- ,
- saare off-diagonals mein hain. Singular branch exact hai — matrix ko bit-for-bit reproduce karta hai.
L5.3 — Sign ambiguity physical hai, bug nahi
Dikhao ki aur same DCM produce karte hain, aur woh convention state karo jo ek unique representative choose karta hai.
Recall Solution — L5.3
KYU: parent note karta hai mein quadratic hai; har entry do components ka product hai, toh saare signs flip karne se har product unchanged rehta hai. Sirf nonzero-driving term check karo: . Chahe ho ya , hai, toh identically; ke liye bhi same. Off-diagonals rehte hain. Dono quaternions dete hain. Convention: enforce karo (aur agar ho, toh pehle nonzero vector component ka sign fix karo). Ye shortest-arc representative select karta hai aur double cover ambiguity remove karta hai.
Recall Jaane se pehle ek-line self-test
deta hai ::: , hence (L1.2, L3.1, L5.1). Rotation phir apply karne ke liye aap multiply karte ho ::: — doosra rotation left pe (L4.2). Gimbal lock pitch par hota hai ::: , jahan sirf recoverable hota hai (L3.3). ke paas aap divide karte ho ::: sabse bade quaternion component se, se nahi (L3.2, L5.2).