Visuliing Quternions Andrew J. Hnson Computer Siene Deprtment Indin Universit Siggrph Tutoril GRAND PLAN I: Fundmentls of Quternions II: Visuliing Quternion Geometr III: Quternion Frmes IV: Clifford Algers I: Fundmentls of Quternions Motivtion D Frmes: Simple emple, omple numers. D Frmes: Rottions nd quternions. II: Visuliing Quternion Geometr The Spheril Projetion Trik: Visuliing unit vetors. Quternion Frmes Quternion Curves Quternion Splines III: Quternion Frmes Quternion Curves: generlie the Frenet Frme Quternion Frme Evolution Quternion Curve nd Surfe Optimition IV: Clifford Algers Clifford Algers: Generlie quternion struture to N-dimensions Refletions nd Rottions: New ws of looking t rottions Pin(N), Spin(N), O(N), nd SO(N)
Visuliing Quternions Prt I: Fundmentls of Quternions Andrew J. Hnson Indin Universit Prt I: OUTLINE Motivtion D Frmes: Simple emple, omple numers. D Frmes: Rottions nd quternions. 8 Motivtion Quternion methods re now ommonple in grphis. Quternions re ver geometri, ut we seldom ttempt to visulie their properties geometrill. Bsi Issues Bsi ft numer : Rottion mtries re Coordinte Frme Aes. Bsi ft numer : Rottion mtries form groups, whih hve geometri properties. Tht s going to e our jo tod! 9 Tsk vs Strteg Our tsk: Understnd Rottions. Rottions don t just t on geometr, rottions re geometr. Our strteg: the geometr should help us to visulie the properties of rottions. Simple Emple: D Rottions D rottions ) geometri origin for omple numers. Comple numers re speil suspe of quternions. Thus D rottions introdue us to quternions nd their geometri mening.
Frmes in D Frmes in D The tngent nd norml to D urve move ontinuousl long the urve: The tngent nd norml to D urve move ontinuousl long the urve: N^ T^ N^ T^ Frmes in D The tngent nd norml to D urve move ontinuousl long the urve: Frme Mtri in D This motion is desried t eh point (or time) the mtri: N^ T^ R () h ^T ^N i os, sin sin os : Another D Frme If we did not know out os + sin, we might represent the frme differentl, e.g., s: R (A; B) with the onstrint A + B. A,B B A : The Belt Trik: Is There Prolem? Demonstrtion: Rottions wnt to e douled to get k where ou strted. See: Hrt, Frnis, nd Kuffmn. 8
Hlf-Angle Trnsform: R () Hlf-Angle Trnsform: A Fi for the Prolem? os, sin, os sin os sin os, sin A Fi for the Prolem? Or, with os(), sin(), (i.e., A,, B ), we ould prmeterie s: R (; ) where orthonormlit implies,,, : 9 ( + ) whih redues k to +. Frme Evolution in D Hlf-Angle Trnsform: So the pir (; ) provides n odd doule-vlued prmeterition of the frme: h ^T ^N i,,, : where (; ) is preisel the sme frme s (,;,). Emine time-evolution of D frme (on our w to D): First in (t) oordintes: h i ^T ^N os, sin sin os Differentite to find frme equtions: _^T(t) + ^N : _^N(t),^T ; where (t) ddt is the urvture. Frme Evolution in (; ): Frme Evolution in D Rerrnge to mke vetor mtri: _^T(t) _^N(t) +(t),(t) ^T(t) ^N(t) Using the sis (^T; ^N) we hve Four equtions with Three onstrints from orthonormlit, for One true degree of freedom. Mjor Simplifition ours in (; ) oordintes!! _^T _, + _,
Frme Evolution in (; ): But this formul for _^T is just ^N, where or ^N,, ^N,,,, D Quternion Frmes! Rerrnging terms, oth _^T nd _^N eqns redue to _, _ + This is the squre root of frme equtions. D Quternions... So one eqution in the two quternion vriles (; ) with the onstrint + ontins oth the frme equtions _^T + ^N _^N,^T ) this is muh etter for omputer implementtion, et. Rottion s Comple Multiplition If we let ( + i) ep (i ) we see tht rottion is omple multiplition! Quternion Frmes in D re just omple numers, with Evolution Eqns derivtive of ep (i )! 8 This is the mirle: Rottion with no mtries! + i e i represents rottions more niel thn the mtries R(). ( +) + i )( + i) e i( A + ib where if we wnt the mtri, we write: R( )R()R( + ) A, B,AB AB A, B The Alger of D Rottions The lger orresponding to D rottions is es: just omple multiplition!! ( ; ) (; ) ( + i )( + i), + i( + ) (, ; + ) (A; B) 9
The Geometr of D Rottions (; ) with + is point on the unit irle, lso written S. Rottions re just omple multiplition, nd tke ou round the unit irle like this: The Geometr of D Rottions (; ) with + is point on the unit irle, lso written S. Rottions re just omple multiplition, nd tke ou round the unit irle like this: ( -, + ) (, ) ( -, + ) (, ) + / (,) / (,) + / (,) / (,) The Geometr of D Rottions (; ) with + is point on the unit irle, lso written S. Rottions re just omple multiplition, nd tke ou round the unit irle like this: ( -, + ) + (, ) / / (,) (,) Quternion Frmes In D, repet our trik: tke squre root of the frme, ut now use quternions: Write down the D frme. Write s doule-vlued qudrti form. Rewrite linerl in the new vriles. The Geometr of D Rottions The Geometr of D Rottions We egin with si ft: Euler theorem: ever D frme n e written s spinning out fied is ^n, the eigenvetor of the rottion mtri: n ^ We egin with si ft: Euler theorem: ever D frme n e written s spinning out fied is ^n, the eigenvetor of the rottion mtri: n ^
The Geometr of D Rottions We egin with si ft: Euler theorem: ever D frme n e written s spinning out fied is ^n, the eigenvetor of the rottion mtri: n ^ Quternion Frmes... Mtri giving D rottion out is ^n: R (; ^n) + (n ) (, ) n n (, ), sn n n (, ) + sn n n (, ) + sn + (n ) (, ) n n (, ), sn n n (, ), sn n n (, ) + sn + (n ) (, ) where os, s sin, nd ^n ^n. 8 Quternion Frme Prmeters To find nd is ^n, givenn rottion mtri or frme M, we need two steps: ) solve for. TrM + os M, M t,n sin +n sin +n sin,n sin,n sin +n sin Quternions nd Rottions Some set of es n e hosen s the identit mtri: ) solve for ^n s long s. 9 Quternions nd Rottions Quternions nd Rottions An ritrr set of es forms the olumns of n orthogonl rottion mtri: An ritrr set of es forms the olumns of n orthogonl rottion mtri:
Quternions nd Rottions Quternions nd Rottions An ritrr set of es forms the olumns of n orthogonl rottion mtri: An ritrr set of es forms the olumns of n orthogonl rottion mtri: Quternions nd Rottions B Euler s theorem, tht mtri hs n eigenvetor ^n, nd so is representle s single rottion out ^n pplied to the identit: Rottions nd Qudrti Polnomils Rememer R (),,,? Wht if we tr mtri R insted of? q + q, q, q q q, q q q q + q q q q + q q q, q + q, q q q, q q q q, q q q q + q q q, q, q + q ^ n Hint: set q q or n other (i j) pir to see fmilir sight! Quternions nd Rottions Wh does this mtri prmeterie rottion? Beuse Columns of R (q ; q ; q ; q ) re orthogonl: ol i ol j for i j Wht is LENGTH of -vetor olumn? ol i ol i (q + q + q + q ) Quternions nd Rottions... So if we require q + q + q + q, orthonormlit is ssured nd R (q ; q ; q ; q ) is rottion. This implies q is point on -sphere in D. NOTE: q ),q gives sme R (). 8
Quternions nd Rottions... HOW does q (q ; q) represent rottions? Quternions nd Rottions... LOOK t R (; ^n)? R (q ; q ; q ; q ) NOTICE: Choosing q(; ^n) (os ; ^n sin ) WHAT hppens if ou do TWO rottions? EXAMINE the tion of two rottions R(q )R(q) R(Q) EXPRESS in qudrti forms in q nd LOOK FOR n nlog of omple multiplition: mkes the R eqution n IDENTITY. 9 Quternions nd Rottions... RESULT: the following multiplition rule q q Q ields etl the orret rottion mtri R(Q): Q h q q i Q h q q i Q h q q i Q h q q i q q, q q, q q, q q q q + q q + q q, q q q q + q q + q q, q q q q + q q + q q, q q Alger of Quternions D Rottions! D rottion mtries re represented omple multiplition D rottion mtries re represented quternion multiplition This is Quternion Multiplition. Algeri D/D Rottions Therefore in D, the D omple multiplition ( ; ) (; ) (, ; + ) is repled D quternion multiplition: q q (q q q, qq, qq, qq ; q + q q + q q, q q ; q q + qq + qq, qq ; q q + q q + q q, q q ) Alger of Quternions... The is esier to rememer dividing it into the slr piee q nd the vetor piee ~q: q q (q q, q ~ ~q; q ~q + q q ~ + q ~ ~q)
Quternions nd Rottions Another mirle: let us generlie the D eqution Quternions nd Rottions... How? We set + i e i q (q ; q ; q ; q ) q + iq + jq + kq e (I^n) Then if we tke i j k,, nd i j k (li), quternion multiplition rule is utomti! ) q q + iq + jq + kq is the stndrd representtion for quternion, nd we n lso use Puli mtries in ple of (i; j; k) if we wnt. with q os() nd ~q ^n sin() nd I (i; j; k). Ke to Quternion Intuition Fundmentl Intuition: We know q os(); ~q ^n sin() We lso know tht n oordinte frme M newritten s M R(; ^n). Therefore ~q points etl long the is we hve to rotte round to go from identit I to M, nd the length of ~q tells us how muh to rotte. Summrie Quternion Properties Unit four-vetor. Tke q (q ; q ; q ; q ) (q ; ~q) to oe onstrint q q. Multiplition rule. The quternion produt q nd p is q p (q p, ~q ~p; q ~p + p ~q + ~q ~p), or, lterntivel, [q p] [q p] [q p] [q p] q p, q p, q p, q p q p + q p + q p, q p q p + q p + q p, q p q p + q p + q p, q p 8 Quternion Summr... Quternion Summr... Rottion Correspondene. The unit quternions q nd,q orrespond to single D rottion R : q + q, q, q q q, q q q q + q q q q + q q q, q + q, q q q, q q q q, q q q q + q q q, q, q + q Rottion Correspondene. Let q (os ; ^n sin ) ; with ^n unit -vetor, ^n ^n. Then R(; ^n) is usul D rottion in the plne? to ^n. Inversion. An mtri R n e inverted for q up to sign. Crefull tret singulrities! Cn hoose sign, e.g., lol onsisten, to get ontinuous frmes. 9
SUMMARY Comple numers represent D frmes. Comple multiplition represents D rottion. Quternions represent D frmes. Quternion multiplition represents D rottion.