13.07.2015 Views

Quaternions and Rotations in 3-Space, With the TI-83 Guy T. Hogan ...

Quaternions and Rotations in 3-Space, With the TI-83 Guy T. Hogan ...

Quaternions and Rotations in 3-Space, With the TI-83 Guy T. Hogan ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Quaternions</strong> <strong>and</strong> <strong>Rotations</strong> <strong>in</strong> 3-<strong>Space</strong>, <strong>With</strong> <strong>the</strong> <strong>TI</strong>-<strong>83</strong><strong>Guy</strong> T. <strong>Hogan</strong>Norfolk State UniversityThe Complex Numbers, <strong>and</strong> <strong>the</strong> <strong>Quaternions</strong> are <strong>the</strong> only possible associative divisionalgebras over <strong>the</strong> reals. The Complex Numbers can be viewed as a 2-dimensional vector space over<strong>the</strong> reals, while <strong>the</strong> <strong>Quaternions</strong> are a 4-dimensional real vector space. Multiplication by a unimodularcomplex number is, essentially, rotation (<strong>in</strong> <strong>the</strong> plane) through <strong>the</strong> angle (amplitude) of <strong>the</strong> unimodularcomplex multiplier. Analogously, <strong>the</strong>re is a multiplication operation, though with a slight twist, byunimodular quaternions which accomplishes a rotation <strong>in</strong> 3-space.If v is a vector <strong>in</strong> 3-space, <strong>the</strong>n v can be viewed as a pure quaternion, <strong>and</strong> if q is a unimodularquaternion, <strong>the</strong>n rotation of v through an angle determ<strong>in</strong>ed by q, <strong>and</strong> about an axis, also determ<strong>in</strong>ed byq,isgivenbyR q : v—–> qvq ?1 .The purpose of this short note is to develop a calculator program (for <strong>the</strong> <strong>TI</strong>-<strong>83</strong>) that willperform <strong>the</strong> transformation above. And this may be worthy of some slight consideration because <strong>the</strong><strong>TI</strong>-<strong>83</strong> does not have symbolic algebra capabilities. <strong>Rotations</strong> <strong>in</strong> 3-space, us<strong>in</strong>g quaternions, is favored,<strong>in</strong> applications, over <strong>the</strong> traditional l<strong>in</strong>ear algebra approach, us<strong>in</strong>g 3 by 3 matrices, because of <strong>the</strong>sav<strong>in</strong>gs <strong>in</strong> computer storage. It is much cheaper to store <strong>the</strong> components of <strong>the</strong> quaternion q than it isto store <strong>the</strong> 9 entries of a 3 by 3 matrix! Besides, <strong>the</strong> quaternion’s components display <strong>the</strong> rotationaxis, as well as <strong>the</strong> angle of rotation.After hav<strong>in</strong>g said that, <strong>the</strong>re is a bit of irony <strong>in</strong> <strong>the</strong> approach we take here, s<strong>in</strong>ce we will rely ona matrix representation of Q (<strong>the</strong> quaternions) <strong>in</strong> order to effect <strong>the</strong> transformations (rotations). But,of course, our objective is not sav<strong>in</strong>gs. Ra<strong>the</strong>r, we only seek to be able to exploit <strong>the</strong> h<strong>and</strong>-heldcalculator as far as is possible.Quickly review<strong>in</strong>g <strong>the</strong> multiplication <strong>in</strong> Q : We use <strong>the</strong> st<strong>and</strong>ard basis, 1, i,j,k, wherei 2 = j 2 = k 2 = ?1, <strong>and</strong>


ij = k, jk = i, ki = j, <strong>and</strong>ji = ?k, kj = ?i, ik = ?j (anti-commutativity).Extend<strong>in</strong>g to all of Q, by l<strong>in</strong>earity <strong>and</strong> associativity, we get a 4-dimensional algebra over <strong>the</strong> reals. Itis customary to write quaternions <strong>in</strong> <strong>the</strong> formto st<strong>and</strong> forÂs,x,y,zÃs D 1 + x D i + y D j + z D k.We use <strong>the</strong> D here to emphasize <strong>the</strong> operation of multiply<strong>in</strong>g a quaternion by a real number. This shallbe suppressed <strong>in</strong> <strong>the</strong> rest of this note. It is also customary to express <strong>the</strong> quaternion Âs,x,y,zà as< s, v >,with s referred to as <strong>the</strong> scalar part, <strong>and</strong> v <strong>the</strong> vector part, with vector components x,y,z. Ifs = 0, wesay that we have a pure quaternion. The pure quaternions are sometimes identified with R 3 . It is noweasy to verify thatÂs, x 1 ,y 1 ,z 1 ÃÂw, x 2 ,y 2 ,z 2 à =< s, v 1 > < w, v 2> = < sw ? v 1 6 v 2 , sv 2 + wv 1 + v 1 ¼ v 2 >where <strong>the</strong> operations 6 <strong>and</strong> ¼ are <strong>the</strong> familiar dot product, resp., cross product, <strong>in</strong> R 3 .When q = Âs,x,y,zÃ, wedef<strong>in</strong>e ||q|| = s 2 + x 2 + y 2 + z 2 , <strong>the</strong> modulus of q. And, of course, if||q|| = 1, we say that q is unimodular. In this case, it is possible to express q asq = < s,v > = < cos S 2 Ã,s<strong>in</strong> S 2 ÃÊ v >,a sort of polar form for q, where Ê v is a unit vector <strong>in</strong> <strong>the</strong> direction of v, <strong>the</strong> axis of <strong>the</strong> rotation, <strong>and</strong> Sis <strong>the</strong> angle through which we rotate.Now take q = < s, v > = , a unimodular quaternion, as above, <strong>and</strong>suppose that w is any vector <strong>in</strong> R 3 . It is fairly straightforward to verify that <strong>the</strong> transformationR q : w—–>qwq ?1is a l<strong>in</strong>ear transformation <strong>in</strong> R 3 ;that v is an eigenvector belong<strong>in</strong>g to <strong>the</strong> eigenvalue 1; that <strong>the</strong> planethrough <strong>the</strong> orig<strong>in</strong>, orthogonal to v, is an <strong>in</strong>variant subspace, <strong>and</strong> that <strong>the</strong> transformation, restricted tothis plane, is a rotation through <strong>the</strong> angle S. This is all well known, <strong>and</strong> an excellent treatment of <strong>the</strong>seideas may be found <strong>in</strong> Chapter Six of [1].For this note, we shall be content to develop a calculator (<strong>TI</strong>-<strong>83</strong>) program to perform <strong>the</strong> rotationtransformation. We consider <strong>the</strong> right regular representation of Q,<strong>in</strong>which


1 ??? >1 0 0 00 1 0 00 0 1 00 0 0 1= Ei ??? >0 1 0 0?1 0 0 00 0 0 ?10 0 1 0= Aj ??? >0 0 1 00 0 0 1?1 0 0 00 ?1 0 0= Bk ??? >0 0 0 10 0 ?1 00 1 0 0?1 0 0 0= CThen <strong>the</strong> quaternionq = Âs, x, y,zà ?? ? > sE + xA + yB + zC =s x y z?x s ?z y?y z s ?x?z ?y x s.<strong>With</strong> <strong>the</strong> <strong>TI</strong>-<strong>83</strong>, we can construct, <strong>and</strong> store, <strong>the</strong> matrices E, A, B, <strong>and</strong> C above. The follow<strong>in</strong>gprogram should be self-explanatory:


The ProgramPROGRAM: ROTA<strong>TI</strong>ON:Input “SCALAR:”, S:Input “[A]-COEFF:”, A:Input “[B]-COEFF:”, B:Input “[C]-COEFF:”, C: ÂS 2 + A 2 + B 2 + C 2 Ã —>W:(S/WÃ ?? > S:ÂA/WÃ ?? > A:ÂB/WÃ ?? > B:ÂC/WÃ ?? > C:Input “1ST:”, X:Input “2ND:”, Y:Input “3RD:”, Z:S D ÄEÅ + A D ÄAÅ + B D ÄBÅ + C D ÄCÅ ?? > ÄGÅ: X D ÄAÅ + Y D ÄBÅ + Z D ÄCÅ ?? > ÄFÅ:ÄGÅ D ÄFÅ D ÄGÅ ?1 ?? > ÄHÅ:Disp [HÅ:Pause:2*arccos(SÃ ?? > L:Disp “ANGLE IS”, L,“RADIANS”:Disp “ANGLE IS”, L D 180/^,“DEGREES”Note that <strong>the</strong> first row of each matrix represent<strong>in</strong>g a quaternion conta<strong>in</strong>s <strong>the</strong> components of <strong>the</strong>quaternion <strong>in</strong> <strong>the</strong> proper order, <strong>and</strong> <strong>the</strong> first column is <strong>the</strong> conjugate of that quaternion.References1. Needham, Tristan, Visual Complex Analysis,

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!