You are on page 1of 196
QUATERNIONS AND ROTATION SEQUENCES A Primer with Applications to Orbits. Aerospace, and Virtual Reality JACK B. KUIPERS PRINCETON UNIVERSITY PRESS PRINCETON, NRW JERSEY ‘Copyright © 1990 by Princeton University Press Published by Princeton Unversity Press, 41 Wilam Street, Princeton, New Jersey 08540 In the United Kingdom: Princeton University Press, Chichester, West Sussex AL Rights Reserved Library of Congress Catlogingin-Pubication Data ‘Kjper, Jack B. 1921- ‘Gueternions and rotation sequences :2 primer with applications to ‘orbits, aerospace, and virtua reality / Jack B. Kuipers. pom Inches tbliographlcal references and index. ISBN 0601-05877 (cloth: alk. paper] 1. Quatersons. Tite. GA196.K85 1908 512.9454-4e21 95.95589 ‘The publisher would like to acknowledge the author of tis volume for providing the camereaty ‘copy fom which tls book was print Priseeton University Press books are printed on _acidtee paper and meet the guidelines fr permanence ‘and durability ofthe Committe on Production Guidetines {or Book Longevty ofthe Counc on Library Resources neppup princeton.ed Printed in the United States of America wos76sas ‘Alo, and ye Elements the eldest bicth Of Natures Womb, that in quaternion run Perpetual Circle, multiform, and mix ‘And nourish all things, lt your ceaslese change ‘Varie to our great Baler sil new praise Paradise Lost, Book V ‘John Milton Contents List of Figures . ‘About This Book . © Acknowledgements 1 Historical Matters LA Introduction . 1.2 Mathematical Systems - 1.3 Complex Numbers 14. Polar Representation 1.5 Hypercomplex Numbers 2. Algebraic Preliminaries 2.1 Introduction . ! 22 Complex Number Operations 221 Addition and Multiplication 22.2 Subtraction and Division 23 The Complex Conjugate 24 Coordinates ....... 25 Rotations in the Plane oe 2.6.1 Frame Rotation - Points Fixed, 25.2 Point Rotation - Frame Fixed 2.5.3 Equivalent Rotations 25.4 Matrix Notation 26 Review of Matrix Algebra 261 The if E 262 Addition and Subtraction . 263 Multiplication by 2 Scalar 2.64 Product of Matrices 26.5 Rotation Mattioes 2.7 The Determinant 27.1 Minors 27.2 Cofactors A 2.7.3 Determinant of ann x n Matrix 28 The Cofactor Matrix 29° Adjoint Matrix + % S8SSeSeReRENy Bes 3 3 4 6 9 1 2.10 The Inverse Matrix - Method 1 241 The Inverse Matrix - Method 2 2.12 Rotation Operators Revisited Rotations in 3-space 3.1 Introduction 32. Rotation Sequences in the Plane 33. Coordinates in A 33.1 Successive Sameaxis Rotations . 332 Signs in Rotation Matrices . 3.4 Rotation Sequences in R” . . « 3.41 Some Rotation Geometry... 342 Rotation Eigenvalues & Eigenvectors 3.5 The Fixed Axis of Rotation 351 Rotton Angle about the Fed As 36 A Numerical Example . 8.7 An Application - Tracking 37.1 A Simpler Rotation-Axis Algorithm 38 A Geometric Analysis 381 Xintom . 382 ¥ into yx 38.3 X into x and Y into ya 3.9 Incremental Rotations in F . « 3.10 Singularities in SO(3) Rotation Sequences in f° 4.1 Introduction... . - 42. Equivalent Rotations 421 New Rotation Symbol 422 A Word of Caution . . 423 Another Word of Caution 4.24 Equivalent Sequence Pals 425 An Application . . . 43. Buler Angles 44 The Aerospace Sequence . . - 45 An Orbit Ephemeris Determined 45.1 Wuler Angle-Axis Sequence for Orbits 452 The Orbit Ephemeris Sequence 46 Great Circle Navigation Quaternion Algebra 5.1 Introduction 5.2 Qusternions Defined 5.3 Equality and Addition . . . . SISREBSSSRARR BB er fegaa3y 83 egae OL 103 103 104 CONTENTS 5.4 Multiplication Defined 5.5 The Complex Conjugate 56 TheNorm.... 5.7 Inverse of the Quaternion 58 Geometric Interpretations 5.8.1 Algebraic Considerations 5.8.2 Geometric Considerations . . 59 A Special Quaternion Product 5.10 Incremental Test Quaternion . 5.11 Quaternion with Angle @= 1/6 5.12 Operator Algorithm 5.13 Operator action on v = kq . 5.14 Quaternions to Matrices... - 5.15 Quaternion Rotation Operator - 5.15.1 Ly(v) = qvg" is a Linear Operator 5.15.2. Operator Nori 5.153 Prove: Operator is a Rotation ‘5.16 Quatemion Operator Sequences, 5.16.1 Rotation Examples 6 Quaternion Geometry 6.1 Introduction... . 62. Buler Construction i 621 Geometric Construction 62.2 ‘The Spherical Triangle . 63 Quaternion Geometric Analysis 64 The Tracking Example Revisited . 7 Algorithm Summary 71 The Quaternion Product . . 7.2 Quaternion Rotation Operator 73. Direction Cosines 74 Frasme Bases to Rotation Matrix 75 Angle and Axis of Rotation 7.6 Baler Angles to Quaternion 7.7 Quaternion to Direction Cosines 78 Quatemion to Euler Angles 79 Direction Cosines to Quaternion 7.10 Rotation Operator Algebra, TAO Sequence of Rotation Operstors 7.10.2 Rotation of Vector Sets 7.10.3. Mixing Matrices and Quaternions 106 0 Mm me ng U3 ur ug 120 123 ws 105 21% 17 127 141 aa a2 us M6 ur 151 155 157 158 159 11 166 167 168 168 168 = 169 +170 01 @ “The Real Number Line 4 CHAPTER 1. HISTORICAL MATTERS Te was in the context that William Rowan Hamilton introduced bis algebra of quateraions which, to the total aurprse of the mathe- ‘matical community, violated the law of commutativity for multipli- ‘cation. What seemed to mathematicians of the day to be impossible was to have an otherwise consistent algebra for whieh this funda- ‘mental property ofthe algebra of real numbers did not hold. According to Howard Hves [I], it vas work such as that dane by Hamilton which opened the foodextas of modern abstract algebra. By weslening cr deleting various petites af common alebes, ot by repls {ng ooe or mors of the postage by others, which wre consistent With the romalning postulatas, ex enormous vary of systems can be mdied. As sme ofthese asters we law grouped, quadigroups lope, semigroup, mancids, groups, igs etegral domain, latins, vison rings, Bool rings, Boolean alge, Saks, vector spas, Jordan agate, end Lie algebras, the last two being examples of ton-asoiaivealgsbras. It fe probably courect to sy that mathematicians have, to date, studied well, ‘ver 20 auch algbeale rucrve. ur intent in these pages is to explore the use of Hasilton's ‘quaterions in studying certain transformations in ordinary space of three dimensions. It must be said that it was net loog after the publication of Hamilton's results that Josiah Willard Gibbe end ‘others began to work out the details of what we know today as the algebra of vector spaces, and Hamilton's work seemed quickly to be eclipsed. Recently, however, interest in the use of quaternions has revived, and we want to consider wayy in which quaternion algebra ray still be more effective than the use of eedinary vector algebra. 1.2 Mathematical Systems By the set of rel numbers we shall mean ell numbers which may be represented in decimal form. ‘These include the natural numbers, the integers, and the rational numbers. ‘The sot of natural numbers is the set of mumbers whose arith. ‘metic is etudied in the elementary school, namely, the st N= (,2,8,4--} 1.2, MATHEMATICAL SYSTEMS 5 ‘We mention that this set is closed under addition and multiplics- tion, that is the sum of eny two natural numbers is again @ natural ‘number, and the product of any two natural numbers is also a na ral number, However, the st of natural numbers is not closed under subtraction or division, since there are natural number, say 3 and 5, whose diference 3-5=-2 which is not a notural number. Clearly, the same is true for the quotient of netural mumbers, ‘Tho set of integers is the set Bm {-+~3,-2,-1,0,1,2,3,---} which includes the natural numbers as a subset. ‘This set hes the advantage that it is closed under addition, multiplication, and also ssubtration. Notice that the difference between any two integer is always another integer. However, the integors are not closed under division, ‘To obtain tis fourth propexty we nee the set of rational nuan- fers, namely, the set ofall posible quotients ofthe intogers, except that division by aero is excluded. ‘Ths the rational numbers, ep- recente by the et, Q= {2/0 | pa integers with @ #0} ‘This oot includes both the naturel mimbers and the integers 1s subsets and is closed under all four ofthe ordinary operetions of arithmetic. Tt exhibits the mathematicel structure whic ear lee methematicins began to recognize ut wha, n abstract algebra today, is callod field. ‘The set R of real nusibers, with the bwo cxdinary operations of addition and multiplication, i ancther ex fsmple of il ‘This mathematical eystem is one that is familiar to all of us, and exhibits the following field properties: 1. Closure under the operations that is ifa and b are rea! nus bers 0 area +b and a-b 2. Both of the operations are associative, that is, i , 8, and © fare real numbers, (o+i)+e = at O40 and (@-b)-e = a-(b-0) =o] ONE al “The Real Number Line 6 CHAPTER 1. HISTORICAL MATTER! 43. Both of the operations are commutative, that is, a+b end ab be bee 0, with the property ‘There is an identity for addition, that a+0=040 for evory real number a 5. There ate inuerses for addition, that is, for every real number fa there is e real number, say, —0 , such that a+(-0) (2) +0=0 6. Thece is an identity for multipoation, say 1, such that e-l=l-a=e {for every real mumber a. Further, 1 #0. 7. There are snverses for multiplication, thet ls, for every real smumber a, not equal to 0, there is 8 real number, say o-}, such thet otasaatal 8, Multiplication is distributive over addition, that is for any real rrumbers a, 6, end c we have a.(+d)=0-bta-c ‘These properties for ordinary arithmetic of real mumbers were thought to hold for all algebraic structures; henoe it was s0 surprising that Hiemllton’s quaternions were a consistent alyebraic aystem, yet vic- lated property 3, the commutativity of multiplication, 1.3 Complex Numbers ‘Another example of mathematical system which hes the field prop- exties is that of the compler numbers, It was in the 16th century that the Italian algebralst Bombell, afer Cordan and Tartaglio, had what he called 2 "wild thought.” This wild thought seems to bave been the precursor of the notion of complex numbers, includ- Ing the idea of the complex conjugate. However it was not tntil the 2 1.3. COMPLEX NUMBERS 7 ‘work of Gauss in the early 29th century that the algebra of complex ‘uombers was given a firm mathematical basis. Sine the equate of real number is always non-negative, there is, of course, no solution i the set of real mumbers for the equation 240 or pethaps more generally for quadratic equations of the form ~ Par bo? +t = 0 for say non-zero real mumbers a and 6. But today the numbers which satiefy these two equations are well-known even to most high school students as and 2 £0 aki respectively. Hece i is the now familiar equare rool of —1, having the property that i# = —1. In the complex number, 0-+ib, we often identify a aa the real part and the b es the imaginary par ‘We must be clear, however, what we mean when we wrlte @-+ it, since the symbol I does not represent resl number. Mare specifically, what does it mean to write the product ib when we know that i is not a real nuinber. A mathomatically acceptable Way to answer this question isto identify our representation of the complex number a+b ‘with the par (0,8) ofreal numbers a and 8. In this format, however, we must fist define eyuaity for complex numbers by stating (2,8) = (6.4) and only if a ‘That is to say, two complex numbers aze equal if sd only if their real parts are equal and their smaginory parts are equal e sand Next, in this format, we define the sum and the preduct of two ‘complex numbers by the equations (0,8)-+ (6.4) and (2,8)(e¢) (o+eb4d ay (00~ baad + be) (2) settles 8 CHAPTER 1. HISTORICAL MATTERS ‘We now relate this ordered pals format to the usual a+ ib notation by raking the fllowing associations (0,0) = 0 and (0,1) 4 i Using Equations 11 and 2. we may now compute # = 11) = (10) = 1 as) sothst (0,1) = i = Vo We may then write (0,0) = (0,0)-+(0,1)(0) (14) arid It isnot dificult to show that the difference and quotient of complex ‘numbers are given by the equations (a,8)-(6d) = (a-eb-d) (a2) _ (cetld bem ad, Ga 7 “arr ere ‘This foregoing development may be used to define the arithmetic ‘operations on complex numbers, end to verify that with these def: initions the set of complex numbers does indeed satisfy all of the field properties. We wish, howover, to use an approach which may bbe more familiar to the reader. ‘The algebra of complex numbers is usually defined by essuming that the algebra of real numbers holds for complex numbers as well, except thet # = —1. This means thet for addition and subtraction we have (+i) + (eid) = (e+e) +i(b+¢) (1s) and (0+18)-(c+id) = (0-0) 4100-0) (16) [In like fashion, multiplication is defined es 20+ ibe iad + 1% (oc~bd) +i(be+ad) (17) It should be mentioned that in the context of ecmplex numbers, vector spaces, or even quatemions, a real number is often called 4 scolar. UF in the above definition of the product of two corplex rnumbers we set 6 = 0, then we get product of the scalar a and ‘the complex number ¢ + id as (+38) x (e+id) c+ ind 1.4. POLAR REPRESENTATION ° ‘To compute the quotient of two complex nurabers, we fet note thet the preduct (c+idle- id =e +e is elwaye a reel number. We then write ati _ (o+it\(c—id) crid ~ (e+id)(e~id) actbd , ;bo~ ad eae are (18) 1 pesticular, we may now compute the reiprocal of ¢-+id a3 1 eal <0 a ara 7 HO" = aa lae oo 1.4 Polar Representation In order to make 6 connection with Hamilton's quaternions, we next ‘mention the geometric interpretation of complex numbers. his in- texpretation results from identifying the complex number (0,8), that Js e+, with the corresponding point (a,0) in a coordinatized pane, as in the figure in the margin. For each complex number z= (a,8) we can define a magnitude bl=verR and an angle (often called the argument) by by org(z) =0 where 0 is an angle defined by rand = ba ‘Thus, for example, the magnitude of the complex number 2=(L)) vi hile the corresponding angle is 6 = arctan(I) = 45 degrees or in radian measure, 7/4. 10 CHAPTER 1. HISTORICAL MATTERS Often a geometric interpretation of a complex number z = (0,8) {is made by identifying the mumber with the two dimensional vector (a,8), which we may think of as a vector from the origin to the point (2,8) in the plane. In that case the magnitude ofthe complex ‘umber is simply the length of the vector and the angle of the ‘complex number is the angle between the vectar and the postive X- ‘xis. Geometrically, then, how are the addition and multipliction of complex numbers to be interpreted? eis easy to see that addition of complex numbers comespande ‘exactly to the ordinary parallelogram law for adding vectors. Tn fact, if we think of @ vector in two dimensions as the ordered pair (6,8) the rule for adding vectors is exactly the same as that for ‘edding complex mumbers, as shown by the example in the figure in the margin, In the case of multiplication for complex numbers, it turns out that the magnitude of the product is equal to the product of the magnitudes of the factors, and the angle of the product is the sum of the angles of the two factors. This fact is apparent if we represent the complex number in trigmometric form. If z = (0,8), [2] = 7, ‘and arg(z) = 6, we learn from highschool trigonometsy of a right triangle that a=rcos@ and b=rsind ‘Thus we may write 2 = @!) = ati = reos8 + irsin® (cos +isind) Since by definition e = cos@-+isind womay wiite z= ref (110) where ris the magnitude or amplitude and @ is the angle or argu- ‘ment of z. Thus if we have A = nifosatisina) = ne# (1) zz = rilcosf+isinf) = rae (112) then am = rinfecna tisina)(coof +isinf) (118) = rym(cos acs 8 + Psincsinp +isin aces + icosasin) ni [(essceaef ~ sinasin ) 1.5. HYPER-COMPLEX NUMBERS n (sin acco + eosin = ryrifeos(a+ 8) + isin(ar+ f)] = nn) (114) Hence it eppears that maguitudes are multiplied while the angles are added. Were we to limit oureeves to complex numbers of mag- nudes 1, then multiplication by a complex number amounts to & rotation in the plane. For example, suppose we multiply the vector (4,1) by the vector i = (0,1). Note that f= [0,3)| = vw and arg(@) = x/2 radians ‘The result is the vector (—1,1), which is the original vector (1,1) rotated through an angle #/2, as in the figure in the margin. Perhaps at this point it is worth noting that summing two eom- plex numbers, say, 21 and 2, in polar form quite obviously is not the preferred way to merely get the desired sum. However, working through this summing process anyway does provide # proof of the welllenown cosine lat for triangles. We have (ne) + (re) (roca +rpc08f) + fr sina + msin) and we can write R = \eicwatnes—i + ana snaap? Voir + Priracoola— A) Htrh+2nnome- A) (1s) ata ao Be where Ris the magnitude of the vector sum of 2, and 2» 1.5 Hyper-complex Numbers Although we have just interpreted the product of complex num- bers geometrically as the rotation of vectors in o plane we might just as well have thought of it as a transformation of points in the plane In our example above, multiplication by i = (0,1) rotates the initial point (1,1) into its image point (1,1), where the rota- tion is through the angle 7/2 and has the origin sits center. It ‘was this connection between the algebra of ecmplex mumbers, or double algebra” as it was then called, and rotations in the plane that intrigued Hamilton for years. ‘Makptying by i rotates 2 CHAPTER 1. HISTORICAL MATTERS His problem was to discover an analogous relationship in three imensionsl space, using triplets of real numbers. This he wes un- ‘able to accomplish, for what Ister tumed out to be very good rea sous. The story goes that one morning, while walking with his wife along the Royal Canal, he had @ flash of inspiration. Of an instant he saw that triples were not enough, but rather thet four-tuples Were required. He saw that he needed not just the complex musn- ber component i, but rather three such components i, j, and ky satisfying the relationship: Kaijk= So struck was he by this discovery that supposedly he stopped ‘and carved this equation into the stane of a nearby bridge. And s0 it was that the quaternion was born, ‘There axe good reasons, buried somewhat deeply in the theory of abstract slgebra, for Hamilton having such difculty in coming up with this new idea, Some years later the mathematician Frobenius proved that what Hamilton was trying to do using triplets was not Possible. It was actually the mathematics of the situetion which finally forced him to turn to quaternions, sometimes called comples smurbers of rank 4. We shall see later that these are particulacly ‘well suited for use as rotation operatars in three dimensional space, ‘The set of all quaternions, along with the two operations of adli- tion and multiplication (which we shall define shortly), form a math. ‘matical system called a ring, more particularly @ noncommutative Aivision ring. This longer title merely emphasizes the fact that the product of quaternions isnot commutative, azd that multiplicative Inverses do exist for every non-zero element in the set. Tn summary, the set of quaternions under the operations of add tion and multiplication satisfies ell of the field properties which we iscussed earlier, except for the commutative law for maultiplication, Chapter 2 Algebraic Preliminaries 2.1 Introduction In Chapter 1 we hve already introduced the set of complex mum- bers as an example ofa set of nurabers for which the field properties bold. Early on (in the 16th and 17th centuries) there was cousid- sable suspicion, accusation of mystique and even ridicule directed at those bo believed in the existence of these so-called “im nary” numbers. The curious term imaginary number actualy dates back to those times. And although today we know there is nothing imaginary” about these numbers — they do indeed exist — the name stuck, Tt was not until early in the 19th oentury, however, that math- ‘ematicians (particularly Gauss) had formally devised the complex number system in order tool atleast quadretic equations. Speci ically, equations of the form 48 =0 Pox + 0° 4 for any non-zero real numbers, and b, were no longer declared es ‘ot having a sotuticn! ‘Today, the numbers which satisfy these two equations are well known even to mest high school students as being z= ib md oz = atid cy. respectively, where ? Imaginary Numbers enter et ay a be Complex Number Polar Form ae “4 (CHAPTER 2. ALGEBRAIC PRELIMINARIES In summary, numbers of the form a+ a+ti ‘where a and b are real mumbers (i? = —1), has come to be known 18 6 compler number or sometimes an imaginary number. The letter 2, by common convention, is used to denote a complex nuraber, and 2 = a+ ib is read as “the complex number o plus ib” In this so-called Cortesizn representation for a complex number, the real ‘number a is called the real part, while the product ibis called the imaginary port. ‘The polar representation of this complex number is lusteated bere in the margin. The notion of uniqueness of the polar representation of a complex number is presented in & margin note across the page. ‘The real numbers are a subset of the complex numbers obtained by setting 6 = 0; Likewise, the eet of all purely imaginary numbers js a subset of the complex mumbers obtained by setting a = 0. In this context, the real numbers are said to be of rank 1, the complex numbers are of rank 2, and the quaternions are sald’to be hyper- complex numbers of rank 4, In Chapter 1 we mentioned thatthe set of rational nuibers, the sot of real numbers, and the set of complex numbers ace all examples (of afield, and we listed there the feld properties that these numbers satisfy. The set of real numbers, that i those numbers which mey be written in decimal form and are the subject of study in elemen tary school arithmetic, is perhaps the most common and familiar to all of us — mathematicians and non-msthematicians alike. While ‘we may not realize it, all of those operations which may legitimately be performed in our day-to-day housrkeeping computations are in fact based on the feld properties for thooe numbers. We now show, in some detal, that the less-fazailiar set of com plex mumbers also satisfies these same field properties, In doing 0 we shall use, in general, the a + i notation rather than the ot- ered pair (a, 8) notation for a complex number. Our purpose in doing so is, fist, to gain some appreciation for the algebrale struc- ture which these mumbers exhibit and, second, to provide important background for developing the properties and the algebra of quater- 22, COMPLEX NUMBER OPERATIONS 15 2.2 Complex Number Operations \We now verify that the complex numbers, under addition and mu- tiplicetion, satisfy all ofthe field properties. We begin by noting that (by definition) two complex numbers are equal if and only if both real parts and imaginary parts are the same, That is to say atid = ctid © and [Note that here we have used the Cartesian representation for com- plex numbers. For equality of complex numbers in the polar form; somewhat mote restrictive conditions are required, as noted in the margin 2.2.1 Addition and Multiplication Foc every abcd © R (the set of real numbers), we defined in ‘Equation 1.2 addition for complex mmbers by (+B) 4 (e4id) = (0+) +104¢) Multiplication was defined in Equation 1.6 2s (aid) x (eid) = (ocd) + ibe + ad) We mention here that: in the context of complex numbers, vector ‘spaces, or even qusternions, « real munber is often called @ scalar. If in the above definition of the product of two complex mumbers we sot b= 0, then ue get a product of the scalar a and the complex umber oid as oc-+ id) = 0c + iad Since a,b, ¢, and d are all real muzihers, and since the set of real ‘numbers has the feld properties, it followa that a-+6, 4-4, ac~Bd, tnd be-+ad are also real murabers. I then follows from our defin tions for addition and multiplication thet the sum and product of two complex numbers are also complex nunbers; that i, we have the 1 and n > 1. For appropriate values for mand rn the matrix may be a row matrix, 0 column matrix, or a square Rotation Transpose ‘Stee ong on canes. es ey Stping”myettce se att pede 28 CHAPTER 2. ALGEBRAIC PRELIMINARIES 6.1 ‘The Transpose For any matrix A = |a(,j)), the transpose is defined fo(s,4)) [Notice that finding the transpoee of a matrix amounts to interchang- ing its rows and eolurans, Thus, for the matrix A in Equation 218 tho transpoce is “ lott For the reader acquainted with matrix multiplication itis easy to see that the matrix associated with the rotation described by Equations 28 and 2.9 (in which the coordinate frame is fixed while ‘the vector is rotated through an angle 6) is givan by’ a Fe | sind cod (218) We note that this matrix is exactly the transpose of the matrix which represents the rotation described by Equstions 2.6 and 27, Jn which the vectors fxed and the coordinate frame rotates throug the angle 6; that is, we have B= A‘. Tt curs out that this weil always be the case. 2.6.2. Addition and Subtraction If two matrices, A and B, have the same order, that is, the same ‘pumnber of rows and columns, then their sum A + B is computed simply by adding corresponding elements. Tn our matrix notation, we write AB = (lis) +069] ‘An elementary example easly hasrates the deflation. If a(t] [83] om ave=[43] ete anc o sec eer eee eee 26. REVIEW OF MATRIX ALGEBRA 2 Further, the negative of a matrix A ts defined by ~A=[-alt,3)) that is, —A Is @ matrix whose elements are the negatives of the lements of the matrix A. Notice that for any matrix A we have A+(-A) Subtraction for matrices of the same onder is usually defined as addition ofthe negative that ie A-B=A+(-B) 2.6.8 Multiplication by a Scalar IfAlis a scalar and A is matrix, the product of the scalar and the smotrisis given by A= Prali,j)) tat is, we simply multiply esch element of A by the scalar A. For example, if 13 14 26 w-[2 3] Notice that we may now, for exemple, write A+ A = 24 and (DA thea 2.6.4 Product of Matrices ‘The product of two matrices is a bit more complicated to define We begin by reviewing the dot product of two vectors. If we have two vectors in F#, say, a = (en) end b= (byte) the dot product is a:b = ayb+0sbe ‘Thus it a = (3) and b= (4,2) we have ab = (48)-(-4,2) = 1(-4) +32) 446 = 2 26, REVIEW OF MATRIX ALGEBRA a ‘The element in the 1* row and 1* column of the product, AB, is the dot product of the 1 row of the matrix A and the 1" colutan : of the matrix B, that i, 0 CHAPTER 2. ALGEBRAIC PRELIMINARIES [Note that the result ise scale If we hove vectors in R® the definition is analogous. For example, Matrix Product ewe ay deft pedt 7 (13)-(0,4) = 1-043-4 = 12 a (2,8,2) ‘Proceeding in exactly the same way with the remaining elements iti } b = (2-17) the product, we obtain: j = -1) +N =18 t b = 1a) +--+ wo [4 3][23]- [22 The definition extends to vctr considered as m-tapes nF, for wa 7|[45| 7 [2 a7 _ a (0403, 04) However, we also compute the matrix product ecmmted, thot is oa}fa s]_[-4 oo ae (f2][53]-[28 theo +eabe Using ordinary summation nottion, we may nidy wite this dot product as i b=) onby Now consider an'm xp mate A(m,p) ond a px matrix Bp, ). [Note thatthe number of columns, pn Ais the seme asthe namber of rows in the matrix B. This mist be the case if we are to be able to compute the matrix product. AB. ‘The result willbe an m x matixC, ‘The product ie defined by this rule: ‘The clement in the row and the j* colin ofthe product AB isthe dot product of the ® row vector of the matric A fad the 3 column vector of the matrix B. ‘Ths if the # row of A is (an, @2y:*-€n) Sad the j* column of B i (belay bys) then the element comman tote row and the gM ealumn of C= AB ie to) = Seat Notice thet here we have used double subscript notation for the clements of « matrix. We give one numerical example. Suppece jis 02 ae[43] mt 2-[33] 1 ‘and note that the results are not the same. From this we may conclude that Matrices do not commute under multiplication — and therefore the mathematica eystem which consists of the sot of all 2 2 matrices is not a field. ‘Any square matrix with al 1's on the diagonal and zeroes elsewhere fs an Identity matrix, usually dencted, I. It is ealled an Identity matrix because Alm I, 2.6.5 Rotation Matrices We return now to the rotation ia the plane in which the coordi= nate frame rotates while the points (or vectors) remain fed. ‘The transformed coordinates were given by = moos ty sind Ye = mcosd~asind I we write theee equstions in the slightly altered form By = (cosd)z1 + (sinBhnr ta = (~sinB)zs + (cosd) we may recognize that both equations ace contained in the single matrix equation [3] - [2% 22] [a] Commutivity eowtanding what ae ut ‘esd son cma emit, ay 33 2 CHAPTER 2. ALGEBRAIC PRELIMINARIES If in terms of vectors we write rj = colfss,yn] and rz = collts an) and define the matrix A by a= (22% 25] then the above matrix equation has the simple form edn In this equation, A is called the rotation motrés or equivalently 8 rotation operator which takes ry into Fa Ii this same fashion we may verify that for the second type of rotation In the plane, in which the coordinate frame is xed and the point (oe vector) rotates, the appropriate rotation matrix is 5 le cal sind cos8 ee) [Note that this matrix B is the transpoce of the matrix A, that is B= Consider once again the rotation matrix A associated with the rotation of the coordinate frame through an angle @ while the point (or vector) remains fixed. We will have occasion to consider how uch a rotation can be “undone,” that is, how the effect of the Totation can be negated. If we thick about it fore moment, it seems clea that there are two ways todo this. First, we may simply rotate the coordinate fremne through an engle -6. Surely this will return things to thelr original position. Second, though this is not quite fo cleas, we may rotate the point (or vector) through an angle @ ‘while the coordinate frame remains fixed. Now an interesting thing Ihappens. ‘The matrix which represents the first of these possibilities ‘may be obtained by replacing 8 by -O in the matrix A. We get ces(#) sia) e=[ 28% coca an cos 0 and sin(—8) ‘Since we know, ccs(~8) ~sin8, the matrix B may be written (218) [fees But this is exactly the matrix B of Equation 2.16, namely, the transpose A". From this we learn that the rotation matrix needed 27. THE DETERMINANT 33 to “undo.” that i, to tnvert the rotetion represented by the matric Ais exactly the matrix A’. Or we may say that the inverse of ‘e rotation matric is its transpose. The inverse of a matrix A in general we consider in following sections We invented that there was a second way to invert the rotation wwe are considering, and that was to follow it by a rotation of the point (or vector) through an angle 8 while the coordinate frame remains fixed. As we noted above, the matrix associted with this rotation is exactly the matrix B of Equation 2.14, whieh in fact is At. Thus we obtain exactly the same result as before, so the two ‘possibilities are in fact equivalent. ‘We note finaly thet these results hold whether the angle 0 is positive or negative, thet is, the result does not depend on the 2 we first introduce and define, by example, some preliminary matters relating to m x n matrices 2.7.1 Minors Consider the square matrix: an a2 ag] [10 1 A= [en on os|=| 21-1 (219) an oe on} Lo. 2 Aseoclated with each element ay of the matrix A is @ minor denoted Ay. Minor Ay is a number which is equal to the, value of the {determinant of the eubmatrix obtained by deleting row ¢ and eclumn oR Ss Ck ek AES RE RNAI 27. THE DETERMINANT 35 {of the mattix A, For example, inthe matrix of Hquation 219, the minor of the element ase is Aw oy ay] ft 1 on a} ~ | 2-1 2.7.2 Cofactors ‘The cofactor associated with the element ey is denoted and defined by AS = (Ay that ia, it is @ signal minor. For the above example, then, the cofactor is A = (Aw = (1 2.7.3 Determinant of an n x n Matrix ‘We now can calculate the determinant of any nxn matrix in terms of any selected row (or eolume) and the associated cofactors of this selected row (or column). For example, let B= n x n matrix. Then expanding over any selected row, say the row, we have Sous, det(B) Or sea, f we expand over, sey some j* column, we have aet(B) = So sBis Choosing a row (column) with some elements equal to zero cbvi- ously simples the required computations in the indicated sums ‘There are methods for genersting the desired zerces in order to simplify the computation of a determinant, but we shall nt review these here Using Equation 2.19 and expanding about the third column we | an se aet(A) eas Minor - Cofsctor ‘Thee m at Mne(nde termina) cot en Depa Kiver mga incareet te ‘sted Gaacer bs en Rank >4 copa te lati Matrix Blements Determinant Rules (eta, wll a re eg ie ely ‘ropa fects pes Sea er eran 36 CHAPTER 2. LGEBRAIC PRELIMINARIES cr if we expand about the second row Jou os | oss on an ass ald) Jar asa] In either case we get the expected result we were taught in sec- ‘ondary school, det(A) = onazose + ds20a.0e + 01021002 ~erstizais ~ andas0sr ~ Oxrdn053 (2.20) Tn fact, the determinant can be found by expanding about any row or column If wo replace these elements by their numerical values in Zqua- toa 2.19 we get det() Hf det(A) = 0 we say A is singular. Otherwise, A is said to be non-singular. Its only a now-singular mstrix that is invertible, that Is, it haa an inverse In summary, the value of the determinant of any nn square matrix, B, can be found by the following procedure 1. Choose any row (clus) 2. Compute cofactors for elements in chosen row (column). 3. det(B) = Dh. ag Bf for chosen clam j, of 4, det(B) = Ts is x BG for chosen row ¢ 2.8 The Cofactor Matrix ‘The cofactor matrix, denoted A°(i3) or simply as AF, for the matrix A= ols] Ai) = (45) ‘where each ofthe elements of Af; ae the corresponding cofactors of, the matrix A. That i, the cofactor matzix A® is constructed from the matrix A by replacing each of its elements by its cofactor. 29. ADJOINT MATRIX oT ‘As an example, consider the $ x S matrix A given by 101 A=|214 o12 Earlier we calculated the cofactor of the element ayy = 1 to be ‘4% = 3, 20 in the cofactor matrix the element 1 is replaced by ite cofactor 3. The reader should check that if this ie done for each of the elements in the mntrix A the result is the cofactor matrix 3 ae|i A 2.9 Adjoint Matrix “The aint matrix denoted At, ofthe matrix Ais simply the trans pote ofthe cofactor mutixof A. That A= (Ay nati A above is the matrix Sieh el 123 2-11 We next review two ways in which the inverse of any square non- singular matrix may be computed. ‘Thus the adjoint of our 2.10 The Inverse Matrix - Method 1 ‘The frst method is based on the ideas we have Just presented. Tf et(A) is not zero, that ie A is non-singulas, we may compute the inverse, A~, cimply by dividing the adjcint matric A* by the de- terminast of A. That is ae A aaa) Jn our example the result ie aet(A) #0 "The reader should now verify that the product AA is indeed 88% 3 identity matrix. + Mabe A= = Min: aoe 200) = Wena) Ait A= 49) Note SSS 38 CHAPTER 2. ALGEBRAIC PRELIMINARIES 2.11 The Inverse Matrix - Method 2 ‘The second method for finding the inverse of a matrix is quite dit: ferent, and is based on the Cayley-Hamilton Theorem which states thet very non-singular matric satisfies its own characteris tic equation. Every nx n matrix A has a characteristic equation defined by aet(A—M) = 702) In general, the characteristic equation of ann x m matrix has the form A) = Pag aN tsb aAtae = 0 ‘Therefore, invoking this theorem, we have HA) = AN Hag Al boos tas bag = 0 Multiplying both sides of this polynomial by A~* and solving for the inverse yields, a [A agra? 1 2 apd bay ‘This method for finding the inverse is quite simple for 2x2, and ‘even 3x 3, matrices. ‘As en example, we wl id the inverse for the 2 2 mati a4 w(t] ‘The characteritic equation for the matrix M is defined by 20) aus isd o a 5A42 MA sa 42r ooo a ca ak asia it a 212. ROTATION OPERATORS REVISITED Ey Multiplying this equation by M* gives M~s1+2M roma care art = Hera ijfso]_[aa {le s)-[1 2} nip [27] ‘As a second example, we find the inverse for the 3 x 3 matric ‘The characteristic equation for the matrix A is « polynomial equar tion found by solving the determinant PQ) = 5-6 OP - = 0 re Se etic ont 5I-6A4+44°— AP = 0 ata Mormaanad han f if a st 1 ‘The intermediste computational details, that ic solving for A and summing multiples of matzioes, ae straight-forward. This result, of course i the same as that obtainod by Method 1 2.12 Rotation Operators Revisited In Section 2.6.5 we derived rotation operators for rotations in K? of ‘the coordinate frame and of the points (or vectors). In the case of Rotation Matrix? Lda iae ot Note 0 CHAPTER 2 ALGEBRAIC PRELIMINARIES ‘rotation of the coordinate frame through an engl @ the rotation operstor is A= | sing cose [ cos sind | ‘while in the case of « rotation ofthe points (or vectors) through an angle 6 the rotation operator is given by = (25) We noted that the operator in the one case is exactly the transpoce of the operstor inthe other. Infact, each is the inverse of the other. If should also be mentioned that the matrix representation of a ro tation is unique. The only matrices that work are those we have ound. ‘We went to consider two propertice which these roatrices have, 1s well as to determine conditions under which a given 2x2 matrix is 1 rotation operator. ‘The fist property we note is that each ofthese ‘operators has determinant +1, as the reader may easily verify. Tt ‘tums out that this is always the ease with a rotation operator. ‘The second property is that each ofthese rotation matrices is orthogonal. ‘We say a matric A is orthogonal ifthe product of the matrix and its transpose is an identity matrix. Thetis, an n x matrix A is corthegenal when AA = AB Equivalently, we mey say a square matrix 4 is orthogonal if itis invertible and its inverse is exsctly its transpose. With the use of the familiar trigonometric identity coe? tein? = 1 the reader may ensily verify that the rotation operators A and B above are indeed orthogonal, ‘We mention, without proof, that the determinant of the product of two matrices is the product ofthe determinants ofthe individual ‘matrices. In pecticular if matrices A and B both have determinant “+1, 20 does their product AB. Fusther, if both A and B are on ‘hogonal matriow, the product AB is also orthogonal. ‘This is fairly ‘easy to show, once we recall that in general (aby = Brat 212. ROTATION OPERATORS REVISITED a ‘Then we may write (ABYAB)! = ABBYA' Ala As a ‘which is what we needed to show. Finally we show that if a 2 x 2 matrix is orthogonal and has determinant +1, then It must be a rotation matrix. The details of the argument are somewhat tedious, but it may be well to consider them, since we are dealing with conoepta importact to our work. Let the matrix A be given by a= [ee] on On We sme tha Ais rtogonl and has deteminast #1. These Ive saline yl the flpwing euocs ayag toon = 0 eucn—oaen = 1 tte = 1 Gy to = 1 Now if we add the third and fourth of these equations then, subtract twice the second equation we obtain (hy ~ Zane + 08) + (aly + 2arzonr +08) that is, we have (au ~ on)? + (ax ton)? = 0 rom this equation it follows that gee eae i oe [a] +P m1 s0(2) “The goxp $04) komen of Seal cena Note A Polar Domain 42 CHAPTER 2. ALGEBRAIC PRELIMINARIES ‘This implies thatthe point (ab) lies somewhere on a circle of radius 1, 50 there is an angle such that a = cos and b= sin 8, Therefore the matrix must be of the form a> [2% 25] ‘But this is exactly the rotation matrix fora coordinate frame rota- tion through an angle @ In this analysis, the angle 0 may be replaced by the angle -0, ‘which would prodiice the rotation matrix associated with the ro- tation of points (or vectors) through an angle 6. Hence we have characterized rotation operators in A® as exactly those 2.x 2 ma- ‘trices which are orthogonal and have determinant +1. Since the product of orthogonal matrices is orthegonal and the determinant of a product isthe product of the determinants, it fllows that the product of two rotation operators is always another rotation oper- ‘ator. We shall explore these matters further in the next chapter, ‘where we extend these idess to three-dimensional spane, designated 3 PTS 43 Exercises for Chapter 2 Same exerecises which follow are intended merely to help readers recall matters which may have been long since forgotten, ‘They should provide the reader not only an opportunity to brush away some dust collected on ideas from disuse but also may encourage tn effort to understand and apply the materia presented. The ex cerciss in the following chapters also, hopefully, will continue this reclamation proces. + id Given sy = 0-+ib and up Find the product t= 11 #2 2, Find the quotient wy = v/v 8. Find the argument and magnitude of wy nd ws. 4. Expres the following in exponential fora: () 4 = 2-2 ( m=4-i4 ( 4 = 348 () aa3tit Find 27! and oj" coma Au [2 3 nea [d 3h] a ae 8, Find A“ and B- using Cayley-Hamilton Theorem, Chapter 3 Rotations in 3-space 3.1 Introduction In Chapter 2 we considered rotations in two-dimensional space, Le. Fi, and how such rotations are represented by matrices of the group ‘80(2). In pacticulac, we'made a careful distinction between a rota tion of the coordinate frame with respect to fixed points (or vetors) 1s opposed to a rotation ofthe points (or vectors) with respect to a fixed coordinate frame. Infact, ifin both eases the angle of rotation 4s +6, then it was noted that the rotation operater for the one case ‘was simply the transpose ofthe rotation operator for the other case. ‘We noted further that the one is the inverse of the other. In this chapter we extend these ideas to the three-dimensional case, that is, to RE Our ultimate objective is to show how quaternions may be used a rotation operator in RY. In this chapter we consider first a simple sequence of rotations in Fi, that is, in the plane. We then velop mstrices as rotation operstorsin F®, and consider sequences of rotations in P9, all in terms of matrés algebra, Wie apply these result tothe aerospace application of tracking a remote object, and conclude with @ geometric analysis of the single axis equivalent of the tracking transformation. 3.2 Rotation Sequences in the Plane We now consider what happens when one rotetion is followed by nother, that is, whet is the result of a sequence of two rotations Suppose & rotation of the initial coordinate frame (points fixed) through an angle a is followed by a rotation of the resulting coor- inate frame through an angle B. Clearly the result is # rotation of 6 soy) Righetti tend 46 CHAPTER 3. ROTATIONS IN 3.SPACE the initia! coordinste frame (points fixed) through an angle a-+ 6, ‘as Mlusteated in Figure 3.1. The aves of the reference frame are = \ Figure 8.1: Rotation Sequence in R? Ye labelled X and ¥. Consider any vector v defined in this reference frame, We define a new frame, labelled, xy and y,, which is related to the reference frame by a rotation through an angle a. The vector ¥ defined in this new frame we denote v; and we write vi Rat vb tn mn i per ten [ Se See] Next, we define another new frame, which is rotated through an angle 6 with respect to the 2), frame; the axes ofthis new frame fare labelled 2, and yz, respectively. We then can write vem Rov where the matrix rotation operator is cates | Ro= ‘Then, using roles of matrix algebre, we may write va = Rem Re(Rav) (ReRay 38. COORDINATES IN Fe a ‘This equation shows thet the rotation operator for the sequence of rotations is exactly the product of the two individual rotation oper- tore Ry end Ry; that is we may obtain the vector vz directly from the vector v by multiplying v by the product Fp Using the rules for calculating this product, as well as two familiar trigonometric identities, we may write fone = | Sth [Sito See] aE ee ert yz = cxsfsina +sinficose = sin(a-+ 6) —sinplecsa — cosfisina = ~sin(a+ 6) ox aq = —sinfidna+ cos cosa = cosla + A) ‘Thus we have coola+ A) sinfa+ 6) rs [ee baer We notice immediately that this final matrix is just the rotation operator representing a rotation of the coordinate frame through 8x fanzle a+ 8, while the points (or vectors) remain fixed. ‘Thus we hhave shown, algebraically, that « rotation of the freme through an ‘engle a, fllowed by another rotation of the frame through an angle Bis equivalett to & single rotation through an angle a+ 8, 98 we asserted earlier. 3.3 Coordinates in R* ‘Three-dimensional space, designated F°, may be coordinatized in ‘2 vay which is entirely anelogous to the way in which we intro- duoed coordinates in F?. In R® an arbitrary but fixed point is specified which we call the origin. Three mutually perpendicular lines paasing through this erigin are specified, called the X-asis, the Y-axis, and the Z-eris, respectively. Each of these axes is again & real ntmber line, with the zero-point at the origin. These axes are Criented so as to form a positive of right-handed coordinate frame. By a right-handed coordinate frame we mean: with the fingers of the right hand pointing pesitively along the x-axis, then as the fin- gers wrap toward the dizection of the postive y-axis the upright thumb points positively in the direction of the z-axis. The three iutually perpendicular axes, however, may be pointed or oriented Re rons ee pane, he ‘pode oo ah rats, OIR) = Ro+ A seta oe 48 CHAPTER 3. ROTATIONS IN 3SPACE in ay convenient manner with respect to the viewer, consistent ‘with established conventions. Given such a three-dimensional coordinate system, points in R® are now represented by triplets (x2) of eal numbers. The origin, n particulae, bss coordinates (0,0,0). In AS we may represent azy elven point, say P = (x,1,2) as vector v from the origin O to the ‘point P, asin Figure 3.2. Figure 3.2: Vector in F We begin, es we did in RP, wit a rotation ofthe XC¥7, coord nate frame while the point (or vector) remains fxed. Our problem {a to determine the coordinates of the point relative to the rotated frame, More than that, we wish to determine rotation matrix A, recently inthis case 3 > 3 matrix, such thet ifthe coordinates relative tothe rotated frame are given by va~ (ra bu 22) we haxe, Just es in FE wendy Although in A? ve simply rotated the coordinate frame about the origin through some angle 0, in F® simple rotetion about the origin ‘smot well defined. We need also to specify an aris about which the rotation isto occur. For example, in J we may have « rotation of the coordinate frame through an angle #/2 about the Z-axis, where the x and y coordinates change while the z coordinate does not Such @ rotation clearly is quite different from a rotation of the co- ordinate frame through an angle 7/2 about, say, the X-axis where y and z coordinates change but the x coordinate does not. 33. COORDINATES IN RS 9 More specifically, suppose that point P (or vector v) has co- ordinates (11,01,21) relative to the (KY Z) coordinate frame. We rotate the frame about the Z-axis through en angle p. Let the co- ordinates of P relative to the rotated frame be (zy, 22). It seems ‘lear that rotation about the Z-exie will not change the -cooreinale cof the point, and so we must have ana In order to determine 2, and yz, consider the vector vy pictured in the margin. ‘The vector vr is called the prjection ofthe vector v onto the XY plane. In A, vi has coordinates (21,91). Farther, the rotation through the angle about the Zee is dearly jus ‘rotation in R? of the XY coordinate frame through an angle, ‘rotation which is described by Equations 2.6 and 2.7. Hance we must have 1 = neosvtnsiny m= nooy—msiny I we combine those results isto a single set of equations we get B= zycesy + ysing +0. 2, th = ~nsing +4 cose +0-a1 = Om +O-m tla ‘This sot of equations may be written in matrix form as [2] - [SF] 3] ‘We now recognize immediately that the $x 3 rotation matrix asso ciated with the rotation in R° about the Z-axis through on angle is the matrix Ry given by ccs sing 0 Ry = | ~sinw coo 0 (aa 0 0 4 ‘An example will be helpful st this point. Consider the vector v = (1,141) in an XYZ coordinate frame. We rotate the frame about the Z-axis through an angle = x/4, to get 6 new xyz coordinate frame. According to the above results, the coordinates of the vectce v relative to this new frame are Se FE ~Vv3f2 v2/2 0 0 o 0 1 1 1 50 CHAPTER 3. ROTATIONS IN 3.SPACE “The reader should now consider the geometric nature of this rotation of the coordinate frame to see that we have in fact obtained the corect result. 3.3.1 Successive Same-axis Rotations Before leaving rotations of the coordinate frame through certain angles about the Z-axis, we note that if we have a sequence of two such rotations atout the same xis, the fmt through an angle a, followed by a second through an angle 8, the composite rotation ratrix is obtained by multiplying the individual rotstion matrices (Gust asin the case of rotations ofthe frame in A); thet is, we have cna sho 0 ke [= ce 0 0 1 cca sin 0 Ro=|-anB cosh 0 ee and cocla+ 8) sin(a+p) 0 Rote [“Se¥a ces(a+ A) 0 ° ot [Note that ifthe angles inthe above example are equal to zero then these rotation matrices become identity matrices. In this context therefore, it makes sense that for © non-zero rotation about the 2- ‘axis that the r(9,8) entry should be a “1” because the direction of, the z-axis retains unchanged and the values of the z-components of any vectors, whatever their values, also remain unchanged. From the foregoing it follows that if the rotation in R? were about, sty, the Y-axis then the “I” should appear in the r(2,2) position of the rotation matric, because only the Z-axis and the caxis components are affected by a rotation ebout the Y-axis. Hence, for « postive coordinate frame rotation through an angle @ bout the Y-axis the rotation matrix is coed 0 —sind mie | joa oo (32) sin@ 0 cose Similarly, for a postive coordinate frame rotation through aa sngle, 33. COORDINATES IN R* SL 46, about the X-axis the rotation matic is 1 0 0 Re=|0 cose sing 63) 0 sing cosd 3.3.2. Signs in Rotation Matrices ‘There is a useful, if yot Important, point here which the reader might not wast t0 igngre, and that is the proper placement of the sine and -sine terms in the matrices of Equations 8.1, 32, and 8.3. ‘This placement is dictated by our use of a right-handed coordinate frame. A convenient device for determining the proper placement of these terme is the eequence XYZXY ‘Then, reading this sequence from left to right, © positive rotation about the X-axis through an angle ¢ rotates the Y-axis into the ‘axis, and thus the sing term Is associated with the y-coordinate while the -sin term is essociated with the z-coordinate, as written in the matrix Ry above. Next, again reading the sequence from left to right, w rotation bout the Y-axis (in & positive direction in the right-handed co- ordinate frame, using the right-hand rule) through an angle 0 ro- tates the Z-axis into the X-axis. Hence the sin # term is associated with the zeocrdinate while the -sind term is aseccisted with the xccoordinate, asin the matrix, Ry above. Finally, s positive rotation sbout the Z-axis through an angle ¥ rotates the X-axis into the Y-axis, so the term siny) is associated with the x-coordinate while the -siny) term is associated with the yooordinate, as in the matrix Ry of Equation 3.1 It is important to understand how the rotation operstor for & rotation sbout a coordinste frame axis is written because we next evelop the general rotation operator in ° as @ sequence of rota- tions about successive coordinate frame axes. The reader should verify, or at least note, that each of the rotation operators Ry, Re, tnd Ry, which represent rotations of the coordinate frame about & coordinate axis, is orthogonal and has determinant +1. We make use of this fact in the next section Sign of Sine Terms el devi a no Eriepneperantsrered egos See a ‘nan an Te i i ie we i soca) ‘he cep SOU) med Rieter 2 CHAPTER 3. ROTATIONS IN 3SPACE So far in this section we have considered only rotations of the coordinate frame while the points (or vectors) remain fixed. We may also have rotations of the points (or vectors) through a certain ‘angle about a coordinate axis, while the coordinate frame remsine fixed. We do not discuss the details here, but the resulting rotation ‘operators turn out to be the transpose ofthe operetors we have just ‘considered. This is, of course, entirely anlogous to the case in Ft 3.4 Rotation Sequences in R* In the preceding section we showed that any sequence of two suc ‘cessive rotations in F® about the same coordinate axis, whether the ‘Frame rotates or whether the points rotate, amounts to a single ro- tation about that axis through an angle which is the sum for the ‘angles of the rotations in the sequence. We now wish to show that fa sequence of two rotations, say, A=RR in which the rotations are not about the same coordinate axes, is ‘ko @ rotation through some angle about some axis, usually not a coordinate axis. Infact, we shall determine the rotation operstor for such a sequence, that is, the 3 x S matrix which represents this rotation. We chal alo determine this fized amis of rotation, as well as the enyle of rotation shout that axis. 3.4.1 Some Rotation Geometry From geometric considerations it should be clear that for «rotation in F2 about some axis through the origin the axis itself is fixed under te rotation, that ja, it does not change. Further, a plane, ‘parsing through the origin, which is perpendicular to this axis ro- tates into itelf, that is, a vector in that plane is rotated into some cother vector in thst plane. And, of course, the length of vectors, ‘and for that matter, the angle between two vectors is not changed 1y a rotation, which means that the scalar product of two vectors remains unchanged by the rtation, We deseribe this fact by saying that the scalar product 1s émariant under the rotation. We wish fist to argue that the characterization of rotation operators in alo holds in FS, that ic A x38 matriz is a rotation operator in F° if and only ‘fit is an orthogonal matrix and has determénant +1. 34. ROTATION SEQUENCES IN F? 58 ‘We need first to show that a rotation matrix must be orthogonal ‘and have determinant +1. Suppose that the rotation ie through some angle 0 about the vector v as the axis. As we have just mentioned, the scslar product of two vectors is inveiant under the rotation, which means that for any two vectors vy and v2 (4m1)(402) = va But then we have vidtv, = vive ao vidtAva—vive = 0 ‘that is vi(A‘A — Dive o Since tis last equation holds for any pair of vectors vy and ve it rust be the case that AAT thatie AA ° I ‘This shows that the matrix A is orthogonal. [Next itis rather easily shown that the determinant of an or- thogoral matric is either +1 or 1. We know that det(a® and that the determinant of a product is the product of the deter- rminants, so if is orthogonal we bave (cea) dex At)dt( A) det(AtA) = det(I) = Hence det(A) must be either +1 or -1. Now, it should be deer that f rotation preserves the righthandedness of a coordinate frame; hhence we cannot have det(A) = —1. For example, ifthe matrix is 100 o10 00 then the standard right-handed coordinate frame ie mapped into 6 left-handed frame. In fact, the transformation represented by the tmatrix B isa reflection in the XY plane, which leaves the X and Y ‘axes unchanged but revereas the Z aie. Thus the frame becomes ‘a lef-handed coordinate frame. From all this it follows that we must have det(A) = 441. So far we have shown that if 2 matsix A represents a rotation, then A is ortbogonal with det(A) = +1 B (tuTeutne Be othe! wd Eigenvectors Sree fron mateo Shar Se etre A tals oe ery men ic malt oavee we cee se a esos eta an ‘bude sctopra a aaa aa 54 CHAPTER 3, ROTATIONS IN 3-SPACE 3.4.2. Rotation Eigenvalues & Eigenvectors ‘Now suppose thet we have @ 33 matrix A which s ortbogonal and fas deteresinnt +1. We wish to show tat eprenet oation throug some angle about come fixed exis, Since the axis of axy scat ued wer oan, oo ft epi show tha re rust be fixed vector, vo such that Avo=Vo ‘This is equivalent to saying that the matrix A must have a charac. ‘erste value ot eigenvalue of +1. The eigenvalues of the matrix A fare exactly the sealars A which satisly the characteristic equation det(A— 1) =0 ‘Thus there willbe on eigenvalue of + if nd only if the determinant ofthe matrix (AI) is equal t0. The following computation shows thet this i 0 detstde(A~1) = det(Ata— Ad aatt— A) det((t= AY) det(I = A) (Ddet(A—D) det(A— 1) It follows that de{A-1) = 0 ‘Phus our trensformnation does have a fixed vector, sey vo, which fs the axis of the rotation. We next show thet the plane, which ‘contains the origin (and! is perpendicular to this fixed vector va) is fixed in the sense that any vector in that plane is mapped by A into ‘another vector in that plane. ‘We frst remark that since vo is fixed under A, it i also fixed under AY. Ror if Avy Ne 435. THE FIXED AXIS OF ROTATION 8 Now consider # vector v in the plane perpendicular to the fixed vector vo, which means that vive = 0. The vector Av must also be perpendicular to vo, for we have vivo = (Av}'vo = (Av viaAtAvy vive viva = 0 ‘as we wished to show. Finally, ifthe matrix A is orthogonal, then the scalar product {is invariant under this transformation, and it felows that lengths of vectors and the angle between veetors are unchanged under A fas we show in the mexgin. This confirms that the transformation represented by A must be a rotation. ‘To this point we have established that every rotation may be defined by a unique fixed axis and angle of rotation about this axis ‘We now solve for this fixed axis of rotation, 3.5 The Fixed Axis of Rotation We use the standard "Eigenvalue Eigenvector Method” to dete mine the rotation axis, v for a given rotation operator, A. However, sizce we have slready established thet +1 i the only real eigenvalue for any rotation operator, it remains that, we must solve (A-iw = 0 which upon expats give the mogenousequstions (u-Dateuetoum = 0 vs + (02a Toa + oxats yt + oats + (aay ~ te ‘The standard technique is to set, say, vy = 1 and then use ‘any two of the equations to solve for and ty, We use anti + (@z2— Ive eat tasty = (a3 ~ 1) Orthogonsl 1 Ate ctgsn we be (orattaea) = vata = tie 56 CHAPTER 3. ROTATIONS IN 3.SPACE to get one possible expression for the composite rotation axis v= [um a] where ty = G12025 ~ (daa ~ 1)ana te = anes ~ (01 1a ts = (eu D(en—1)~ outa Now that we are able to determine the fixed axis of rotation for ‘gy given rotetion matrix, we must determine the magnitude and direction ofthe rotation about this fixed axis 3.5.1 Rotation Angle about the Fixed Axis ‘There remains the problem of determining the augle of rotation. To calculate the angle of rotation we need the concept of the trace of a tnatrix. The trace of a square matrix A, denoted T7(A4), is simply the sum of the elements lying on the main diagonal of the matrix. ‘Thus the trace of the matrix ‘Trace Property TAB) = THEA) Ts ae [: one | la 0 = AB = bel 0 =sing cond es = Say issimply fs To{Ry) = 1+ 20086 tien ax = Soot We need also to know that for any square matrices A and B (of the same order) we always have wim = De g TAs = Stan © SF ean oF sy rather early be shown when we wall the refer mil ZL ing matrices. See proof in margin. el pods oem ~ SFemea __ Now consider the reaton through an angle @ abou hemi DX" represented by the matrix A. Werewtite ths rotation asa sequence Imechaging ote sommten of rotations about coordinate frame axes, as follows. First, we rotate PSs the frame about the Zsa that che Xe ends wih dhe LLM projection vente the XY plane. We llow with artation about = Mom =D the new y-axis thatthe new xa coinldes withthe vector vo ‘See Figures in the macgin on the previous page. We may represent the product of these two rotations by the matrix Q, ancl we know that Q is orthogonal and hes determinant +1. Then we rotate the | 36. A NUMERICAL EXAMPLE ov resulting frame about the vector Vo, that is, about the new x-axis, through the angle g. Call this rotation Ry. From our earlier work wwe know that 1 0 0 m= [3 te, te] 0 —sing cose We note, incidentally, that THR) Finally, we follow that rotation with the inverse of the rotation , which, since Q is orthogonal, is just Q*. Although itis not too easy Uo see geometrically, the sequence of these rotations is exactly ‘equivalent to our original rotation represented by the matrix A, so we must have + 2c08¢ A= QRQ where ¢ is the angle of rotation. But then we have Tr(A) = TH(Q*RQ) = TOG) THER) = THUR) = TU) Hence we obtain the equation Tr(A) = 14+ 2eo08¢ se, fe afr ge the along oma the all tthe rotation “ eet og 1A) =1 ‘ 2 64) 3.6 A Numerical Example [No doubt « simple mmerical example will kelp the reader to un- ersiand the material in the preceding section. Consider an XYZ coordinate frame, with the vector vo = (1.1.1) in that frame. We consider # rotation of the frame about the vector vp through an angle ¢ = 21/3. It is geometrically clear that such a rotation re- sults in «new frame in which the new x-axis now coincides with the Retain so te new ye ‘The Transformation Q 58 CHAPTER 3. ROTATIONS IN 3-SPACE former Y-axis, the new y-axis coincides with the former Z-axis, and the new z-axis coincides with the initial X-axis. It is interesting to note that a sequence of three such rotations simply carries the intial coordinate frame into itself. ‘We now wich to find the matric A which represents this rotation. Conti the initial X-axis, and in particular the point (1,00) on thet axis. Since the points (or vectors) are Axed while the frame Totates ater the rotation ths poict will le onthe new a-is, and Teuve the new enordinates ofthe point must be (00,1). In the same thay we detraine that the rotation we are considering must change Tenrdinates of pets on the coordinate axes ofthe intial coordinate frame in this way (4.0.0 + 00 (19 + (40.0) (01) + (10) “This tlls us that we are looking for @ matric ne [s a an om 833 ‘(]-E Ita not eifficlt to ee that this equation implies such that on =0, en =0, a Proceeding in exactly the same way with the remaining two vectors above, we obtain the rotation matrix A as o1o0 A= |oo1 100 Given the matrix A, we can now find the coordinates of any point (2,42) relative to the rotated frame simply by calculating the product Av. If we think of the three points (1,0.0), (0,1,0), and (00,1) on the axes of the intel ccordinate frame os forming the columns in 37, AN APPLICATION - TRACKING 59 sn identity matrix, then the matrix A is simply this identity matrix ‘vith its column shifted one columa to the right. In general, the Talix which tepreserts rotation has coluzans which give the new ecortdinates of these points in the rotated frame, Now suppose we are given the metric A above, and are asked what sort of transformation of R® it represents. ‘We check that ‘Ais orthogonal and has determinant +1, which tells us that A dloes represent a rotation. What is the axds of the rotation? To find the axis we simgly look for the fixed vector, that is a vector ¥o = (to,Bo.20) Such that vp does not change under the rotation. We must have 010][% % o01|\w te a % % a er cece tht 1 we solve this eyster, we ip that Poh tcenh Tiaa m= w for nuy real number k. This means the vector (k, yk), for any ‘non-zero Teal number k, is fixed. Tn particular we might designate (1,1,1) as the axis of the rottion Finally, the trace of the matrix A is Tr(A) =04040=0 € 0 that the angle ofthe rotation is given by [No suprise here! o-1 = arco 954 arcece(-1/2) 2/8 which of course is just what we expected. 3.7 An Application - Tracking Inthis section we diseuss an application of rotations in R?, a familiar rotation sequence called the Tracking Transformation. Consider & ‘remote object, such as an aircraft, which isto be tracked from some point on the stzface of the earth. ‘The Local Tangent Plane is simply fa plane tangent to the surface of the earth at this point. We define © (CHAPTER 3 ROTATIONS IN 3-SPACE ‘an initial coordinate frame with the X and Y axes lying in thie tangent plane, pointing in directions North end East respectively ‘The Z-axis is geocentric, that is, it points toward the center of the arth, We then have s right-handed coordinate frame. Rotation Notation ‘seat cegh og ee Figure 8.3: Tracking Transformation We define an angie a, called Heading, which is the angle in the tangent plane between North and the projected direction to the re mote object. We also define an angle f, called Elevation, which is ‘the angle between the tangent plane and the direction to the remote bject being tracked, asin Figure 2.3. The Tracking Tranaformaticn is fst a rotation about the Z-axis through the angle a, followed by ‘rotation about the new y-axis through the angle 9." Notice that in the resulting coordinate frame the new x-axis is pointing diectly ‘toward the object being tracked. If Ris the 3x8 matrix representing this rotation, our preceding results tall us thot Rom RGR: (See nove in margin) cosB 0 ~sinf}[ cosa sina 0 —sine cose 0 0 0 1 37. AN APPLICATION - TRACKING a coracosf sinacosf ~sing oa 0 cosasin# sinasin# coef (35) ‘This composite tracking transformation may be represented as en equivalent transformation which consists of single rotation through some angle about some axis. The aids for this single rotation is found by finding the fixed vector for the rotation operator, that is, ‘8 vector v= (21,44) 74), 883; such that Rvev ‘Thus we have to solve the equation cosacesé sinacos® —sinf ] [x a ssna cose 0 | Im] = | cosasin fs sinasing cose | | a (Our rales for mattix multiplication tell us that we must then have yeosacosf+sinacesé—zsinf = 2 mnsina twocsatn-0 =m myecsasing +ysinasinf + zc0s8 = ‘These equations are easily rewritten in the form mi(cosarcos~ 1) +y,sinacos—xsinp = 0 =nsinaty(csa—1)+4-0 = 0 ycosasin + ysinasing +2(c0s8—1) = 0 [Now this is system of homgeneous equations, which always has the trivial solution v = (0,0,0). Tn order to get a non-trivial solution we may, if we like, set for any now-zero real number k, Then from the second equation above we get kein M wsa=i Finally from the third equation we esleulate ~heos asin ~ y sin asin cos 1 ~heostasin f + keos asin 8 — keintasia (cos — i)(cosa~ 1)

You might also like