Geometric Algebra - Rotors and Quaternions
Transcript
[Music] let's begin this video by reminding ourselves of the graded structure of g3 the geometric algebra of r3 at the lowest level of the structure we have the grade zero elements which are just as scalars there's just one basis element there are just one we have three vectors in r3 these are going to be the three grade one basis elements here the three vectors e1 e2 and e3 next up we have the grade two elements the by vectors also called a pseudo vectors which are formed by taking two vectors at a time two of the three vectors at a time so we get three confident three possible combinations there so we have e 1 e 2 e 2 e 3 and E 3 e 1 then finally at the highest level of the structure we have the pseudo scalar this is a single pseudo scalar which is formed by taking all three vectors at once which is e 1 e 2 e 3 so in total we have eight basis elements in this abstract vector space now remember in the last video we're talking a bit about rotors now what is a rotor this is the geometric product of two unit vectors that is to say two vectors of length 1 now we're in this algebra does a rotor reside in terms of the graded elements that's going to contain now because it's the geometric product of two vectors it's going to contain a scalar or grade 0 element formed by the dot product between the two vectors and a grade 2 part which is formed by the wedge product of two vectors now this is usual way we write the geometric product of two vectors remember you can also write it in this way you like the view times length of V times e to the theta B hat where B hat is the unit vector in the u edge of e plane and theta is the angle from you over to V and these are just the lengths of U and V now the special case where both these are unit length this will just be e to the theta be but this is always going to contain and greet zero stuff and grade two stuff now because it's only going to contain elements of even grade notice these are just the even graded elements here the create zeroes and to create twos we're going to draw our attention to a specific subset of g3 called the even sub algebra so the even sub algebra so this is just what the name says it's the sub algebra the subset of this total algebra consisting only of the even graded elements so what we're going to do is instead of considering any possible linear combination of the eight basis elements here we're going to only consider linear combinations of the basis elements which are of even grade and you can see here there are four of those we have one scalar and three by vectors so it's gonna be some linear combination of the scalar it's gonna have a scalar part and it's gonna be some linear combination of these three basis elements dealing with the by vectors so the most general element of the even sub algebra of g3 is gonna look like this it's gonna be some scalar we save little a plus some linear combination of the by vectors so be another scalar times e1 e2 plus C times e 2 3 plus D times e 3 E 1 C the grade 0 over here and from here to here the grade 2 part and you can see there are four coefficients here in front of each one of the basis element we have a B C indeed therefore the even sub algebra of g3 which we're going to notate in the following plate so it's gonna be g3 but to signify the even part of them just going to mark that with a plus sign so this is the notation we used for the even sub algebra of g3 this even sub algebra is going to be of dimension 4 as if we consider as an abstract vector space is going to have four basis ailments can have the singular scaler and a three basis by vectors so it's over dimension for which if you notice the title of this video the quaternions this is going to have something to do with the quaternions because I claim that this even sub algebra is in fact isomorphic through the quaternions as the same structure as a quaternions but before we start talking about that quaternions elite to first note something important about this even sub algebra namely that it is closed part of the geometric product that is to say if you take two elements that are both in even sub algebra multiply them using the geometric right what you get back out is yet another element of the even sub algebra that is to say this is closed under the geometric product and that can be seen very simply just by inspecting the possible multiplications that can be done with the basis elements of something within within the even sub algebra because you can either there only a few possibilities you can multiply a scalar times a scalar which gives you another scalar you can multiply a scalar times a by vector which gives you another by vector multiply the by vector times a scalar which gives you another by vector about the grade two element or you can multiply a by vector times another by vector now within that there are two possibilities you can have the same by vector being multiplied by itself remember the each one of these by vectors will square to minus one in which case you get a grade 0 term so it's closed to there or you can have a by vector basis element being multiplied by another one by a different one in which case you get plus or minus the third one for example if I multiply e 1 e 2 times e 2 e 3 what I get is e 1 e 3 remember that two squares two plus one which is just the negation of this one so you stay within the grade twos or if you multiply e 2 e 3 times e 3 one where you get is e 2 e 1 which is just a negative of this one and the same thing for the other possibility as well so you see that whenever I multiply two things within the even sub algebra what I get back out is another element of the even sub algebra so this set is closed under the geometric part in other words that's important to note because that's what allows us to make sense of talking about it and sub algebra is a closed set so as I said the even sub algebra g3 plus it's going to be of dimension for considered as an abstract vector space let's yank out those four basis elements so I have that single scalar which is just represented by one I have u 1 e 2 then e 2 e 3 and finally III he 1 so this would be the basis for the even sub algebra of G 3 now let's take note of the algebraic features that we already know from previous videos we know that each one of these each one of these by vectors is basis by vectors e1 e2 e2 e3 and a3 1 each of these squares 2 minus 1 let me write that out in a perhaps suggestive way so e1 e2 squared is equal to minus 1 and so is e2 e3 that also square is 2 minus 1 and so does III II one that also squares to minus 1 now III e1 squares the minus 1 e 1 e 3 also squares to minus 1 now take a look at this times this 1 e 1 e 2 times e 2 e 3 what does that give us we have e 2 squared there that's just equal to 1 so we're left with E 1 e 3 which is also go to - III II 1 so what I get is one basis element times the other giving me a scalar multiple of the remaining one now check this up suppose I renamed these three basis by vectors in the following way let me take a e 1 e 2 let me call that I little eye not to be confused with big eye which is the notation I'm using for the pseudoscalar II 1 e 2 e 3 let me name e 2 e 3 little J and let me take this e 1 e 3 and call that K which by the way that's equal to minus e 3 e 1 equivalent ly e 3 e 1 is going to be minus K in this scheme and let me rewrite this upper line here so I have I squared is equal to J squared is equal to remember I said III one is going to square to minus 1 but e 23 is also going to square root 2 minus 1 so this will be K squared it is equal to minus 1 and I have down here I times J is equal to K I times J is ego okay now if you wanted to set all of the stuff equal to minus 1 you could do the fall you could take this equation multiply on both sides on the right by K in which case I have i j k equals K K or K squared K squared is equal to minus 1 so I have minus 1 over here so you could add that all in to one single equation now what is this equation here this is the defining equation of the quaternions so what we've discovered here is that the four basis elements of the even sub algebra one as the scalar and then e1 e2 is the first by vector e 2 e 3 and E 3 e 1 or minus e1 e3 if you prefer but it doesn't matter because those are just the same up to a scalar well we've discovered that is that this basis of the even sub algebra is also basis for the quaternions 2 and that these algebraically function in the same way as the quaternions do and that you have three things here three by vectors each which square to minus 1 which is the same thing that the eyes J's and KS are doing in the quaternions those are all scoring 2 minus 1 and you additionally have that 1 by vector times the other die the J gives you K when they're multiplied together here this was I this was J this is actually minus K but K is just e 1 III but the same algebraic structure is present here that is to say the even sub algebra of G 3 is isomorphic to the quaternions quaternions are just symbolized by the letter h h4 hamilton basica i'm a guy who would discover them which is to say that you can translate back and forth between the set of things within the even sub algebra of g3 and the quaternions preserving their operations you can do stuff using the geometric product when you're working into the set and you can just as well do operations using the quaternion product using i JS JS incase in the secretory ins you can go back and forth preserving their algebraic structure now when we establish minus a morphism between these two sets you might just say that they just are the same thing they're the same thing going under two different names going under two different notations and because of that isomorphism you might hear me say that the even submerge of g3 just is the quaternions or is the same thing as it Praetorians and speaking in terms of the algebra they are the same thing now that short with a correspondence that going back and forth between the even sub algebra and the quaternions is done in the following way if i have some general element of the even sub algebra let me say a plus b e1 e2 plus c e 2 e 3 plus d e 3 e 1 this is an element in the even sub algebra i can send that over to the quaternions by doing the following just translating the symbols i associated with the fallen quaternion or the following quaternion a plus bi Plus CJ now - DK now I've got a other than that - because remember III one is actually - Kate not Kate so I translate the elements of the even sub algebra into the quaternions by the foot in the following way and this function going from here to here is called the isomorphism and you can go in the reverse direction - if I have something that looks like this and the quaternions I can translate that over to an element in the even sub algebra and the fine way just keeping these coordinates the same just flipping sign on this last one here now it's pretty neat about this is that if you have a second element in the even sub algebra let me say E + f e 1 e 2 g e 2 e 3 + H e 3 e 1 or the A through H those letters are just scalars those are just the coefficients sitting out in front of the basis element this two can be sent over through the isomorphism to a correspondent quaternion which is done in the similar way up here just keeping e FG and flipping the sign of the h there so this would be the quaternion E Plus F I plus G J minus H K now what the isomorphism allows me to do is that suppose I wanted to multiply this thing this element of the even sub algebra by this one let me give this a name just to make it simpler let me call that R 1 and R 2 suppose I want to carry out the operation r1 times r2 using the geometric product I can do that that would also be the same as associating this to its corresponding quaternion which I'll name q1 and associating this r2 to its corresponding quaternion which i'll call q2 carrying out the product over here in the quaternions using the quaternion product using the rules associate with Petronius so is high times J going to K and so forth making sure each one of these is J's and K square so minus one I can carry out that operation get a quaternion over here and then translate that back to an element in the even sub algebra and those two processes are the same if those are saying both for doing the geometric product and also for straight-up addition addition is very easy to see let me say that one more time just to make that absolutely clear these two processes are the same if I take r1 and r2 two elements of the even sub algebra generate a third element of the even solid sub algebra called r3 which is just a product r1 r2 where the product here is a geometric right then translate that over to the quaternions the Associated quaternion which I'll call q3 that is the same as this process mapping this over to its associated quaternion which is called q1 mapping this over to its associate quaternion to and performing the product over here q1 times q2 or this product is the quaternion ik product or the Hamilton product and getting q3 out of that so those two processes are the same and you can go back and forth between this and this but the whole point of this is to preserve the algebraic structure of the events of algebra with the set of quaternions which I'm saying or just they just are the same thing algebraically now people who watch my shell probably know quite a bit about quaternions already because I make videos on those but supposing we didn't know about quaternions here you go a quaternion is just something that looks like this a plus bi times the CJ plus or minus DK just some coefficient front there but because you know how to multiply by vectors for example to multiply e 1 e 2 times e 2 e 3 to get a 1 a 3 you already know how to do with the quadratic product basically you just need to translate back and forth between the symbols just translate when you see e 1 e 2 move that over to an eye where do you see e 2 e 3 moving it over to a J when you see you want you three move that over to okay and in reverse direction suppose I asked you to compute a quaternion a product K I tell me what that's equal to using quaternions just using ice J's in case well K what is K that's you want III going in this direction using the isomorphism what is I that's you want e - well not with just shuffle of stuff around let me wolf II one over there so I swapped there that'll generate a minus sign so I have e 1 squared minus e 1 squared times e 3 e 2 which is equal to minus e 3 e 2 which is equal to e 2 e 3 now what is e 2 e 3 in the quaternions well that's just j so there you go you already know that in a quaternion sky i is equal to j just make the appropriate changes the notation going back and forth and you know how to multiply quaternions if you're not a multiply by vectors which you do know how to multiply by vectors if you've seen the other videos by establishing this isomorphism an important algebraic feature of the quaternions is noticed immediately which is that quaternions algebraically are behaving as by vectors more journalist scalar plus by vector they are not behaving as vectors which is often how you're treating them when you study quaternions on their own you treat them as though there were some sort of augmented vector or they have like a scalar plus a vector part and when we do things like rotations you try to focus on the so-called vector part of the quaternion only now quaternions algebraic are not vectors they are scalar flows by vector and there are elements of even some algebra and more specifically these quaternion ik units the so called the measuring units IJ and k these are not vectors these are by vectors e1 e2 e2 e3 and E 1 e 3 they're not vectors in the sense of pointing vectors like that they are by vectors and the sense of wedge products and oriented patches of area now that's important to note because oftentimes people are very very confusing what the quaternions are they think that they're vectors in this sense there are only vectors in that sense in a very artificial way what they are in a more natural sense are by vectors now when one studies quaternions particularly in the setting of rotations one is often interested in a very specific subset of the quaternions namely the unit quaternions which were those quaternions which are of length 1 or of magnitude 1 now I'd like to show how these linked up with rotors which are something we already have a bit of experience with now to do that what I'm going to do is consider some general element of the even sub algebra of g3 let me call that R it's going to be a plus b e1 e2 plus C e 2 e 3 plus d e 3 e 1 or you can just view this as a quaternion if you prefer except with components a B C minus T in our naming scheme as we've seen before now remember that the rotors had an additional very special feature which is that our dagger times our and also our our dagger or equal to 1 now the dagger was just the reverse operator now what that means is that when you see a product of vectors just reverse the order that's what that the dagger operation means now I'm gonna use a dagger operation to see what happens when we apply this to a general element of a even sub algebra what I'm gonna do is rewrite this in a slightly different way I'm gonna write it as a scaler plus bi vector I'm gonna rewrite it as a plus big B or a big B is just all this stuff from there there that's gonna be be so scaler plus a by vector part it's gonna collapse it like that now if that's what R is what is our dagger here well it's gonna be a plus B all dagger now the reverse operator will distribute to each one of those two terms so a dagger plus B dagger now a dagger the reverse of a scalar is just itself its invariant under the reverse operation so it's gonna be just a now what happens when we take a bi vector and take the reverse of it now a bi vector is going to contain some linear combination of the e 1 e 2 e 2 e 3 and E 3 once now when you reverse one of those let me just say e sub i + e sub j when you reverse that what you get is e j yeah i which is equal to minus e i hey J so when you have a by vector the the effect of the reverse operation is just to negate so that what that means is that B dagger is really just minus B that's the effect of that now this is pretty interesting because in the quaternions what one often does is consider the scalar part to be a sort of real part of the quaternion and this Restless stuff to be an imaginary part now you can see when I look at this reverse operator what it's doing its keeping the real part the same but flipping a sign of the imaginary part that connects up to what I've said probably a number of times which is that the reverse operator is a sort of conjugate operator and that it will preserve the sign of the real part but it'll flip the sign of the imaginary part now we have our dagger here that's just a minus B let's apply this property of the rotor which is that our dagger times R is equal to one so let's consider our dagger R that's a minus B times a plus B which will be a squared minus B squared so just a square of a scaler then minus the square of the by vector now in the video in which we dealt with by vectors in more detail we noted that when we square by vector what we got is the minus magnitude squared of the by a factor where the magnitude is the amount of area contained in that by vector which means that minus B squared is just the squared magnitude of the by vector so really I can write this in the following way our dagger are or are our dagger if you flip the order here it's the same thing that's equal to a squared plus the squared magnitude of the by vector part which is just the sum of squares of a components which is just B B squared C squared and d squared no but the rotor is that's got to be equal to one it's right there in a different way that means that a squared plus little B squared this be up here plus C squared plus d squared is equal to one which is to say in that in these rotors that they are the elements of the even sub algebra such that the sum of squares of the four components scalar plus the three by vector coefficients the sum of squares of those four would be equal to 1 which would be algebraically just the same thing as a unit quaternion that is if you are concerned if you were to consider this as a quaternion a plus bi plus CJ minus DK in our naming scheme a unicorn M would have the feature that a squared plus b squared plus c squared plus d squared is equal to one that is its squared length is equal to 1 now if you've studied quaternions at all particularly in rotations this should make perfect sense because within the quaternions the things that do rotations only without scaling the vector in any way are the unit quaternions specifically those quaternions such that the sum squares are the four coefficients is equal to one now in geometric colors for the things doing the rotations the mathematical objects that do the rotations are the rotors those are the elements of the even sub algebra such that our dagger times our and also how our dagger those are equal to 1 which implies that the sum of squares of those four things those four coefficients are equal to one so can see we can go back and forth between thinking of rotors and unit quaternion and how the rotors in G three these are just the unit quaternion you don't need to study anything in addition you don't need to some sort of ad hoc study of the quaternions just to be able to do rotations to 3d if you know about rotors you already know about quaternions you just know them under a different name and now that we're talking about the relation between rotors and unit quaternion I'd like to point out something else in our study of quaternions in those videos or in your own study you'll note that if you have two unit quaternions multiply them using the rules for quaternion multiplication what you get out of that multiplication is yet another unit quaternion that is to say if I have two quaternions let's say q1 q2 I get another quaternion q3 if Q 1 and Q 2 are unit then Q 3 is also unit this follows very simply from the fact that when you consider the squared length of the product this is equal to the product of the squared lengths individually so that if the length of q1 and a length of q2 are equal to 1 then the length of q1 times q2 is also equal to 1 just applying that formula now something very analogous well algebraically probably the same is true of the rotors that is to say if you take two rotors multiply them together using the geometric product what you get out is yet another rotor we already know that if you take two elements with an even sub algebra multiply them one by the other you get another element of the Eva suppose whether this is something more specific that if you take two rotors multiply one rotor by the other you get a third rotor that is to say going back to this defining feature of rotor said our dagger R is equal to 1 if I have two rotors I'll say R 1 R 2 then our 1 R 2 dagger times R 1 R 2 is also equal to one this is also very easy to see in the last video actually let me review this a rotor is a product of two unit vectors let me say r1 is equal to UV r2 is equal to WX that means that R 1 R 2 is equal to u v w x now consider the reverse of our 1 or 2 that would just be writing this in reverse order which would be x w v u now check this out let me throw some parentheses just to make that clear what is X W well that's just our two reverse or 2 dagger what is V U that's our 1 reverse that's why I want to point out when you have r1 r2 all dagger that's equal to r2 dagger times r1 dagger now check this out our 1 r2 all dagger B if r2 dagger our 1 dagger times r1 r2 r1 by assumption is a rotor therefore r1 dagger times r1 is equal to 1 therefore that's the same as our 2 dagger times r2 r2 also by assumption is a rotor which means that's equal to 1 so this is indeed confirmed that's to say that the rotors of themselves form a group they're closed they have the associative property they inherit that from the higher algebra they have the identity which is just 1 1 is also a rotor and they have an inverse which is just the dagger the fact that the geometric product of two rotors is yet another rotor has a very nice geometric interpretation remember rotors are the things that do the rotating and geometric algebra when they're applied to a vector in the two-sided way now applying a geometric product of two rotors and the two-sided way is a composition of two 3d rotations doing one rotation followed by another now because the geometric project shoe rotors is yet another rotor what that means is that the composition of two 3d rotations is yet another 3d rotation meaning that the equivalent rotation can be done by some other 3d rotation in a single step instead of going in a composite way doing r1 then r2 now as some exercise what I'd like you to do is just consider some element some general element of the even sub algebra call R which is gonna be written in the following way a plus b t1 t2 plus c e 2 e 3 plus de 3 1 now let me define the magnitude actually the squared magnitude of r in the following way our dagger times our show that R 1 R 2 the squared magnitude of that is equal to the squared magnitude of R 1 times the squared magnitude of R 2 and when you show that this shows an analogue of what's going on in the quaternions and that the squared length of the quaternion a product of q1 to q2 is equal to q1 the magnitude of q1 squared 2 times the magnitude of q2 squared so it's showing something very analogous in which case this would prove the fact that a prokta 2 Broder's is another rotor would be a sort of special case of this formula just as the effect that to the product of two unit quaternion is another computer quaternion it's a special case of this more general formula so this is something interesting you might want to prove now operationally both rotors and quaternions are being used to do rotations in natural computations so let's actually compare the formulas of rotations using rotors and formulas for rotations using quaternions now recall with the formula for a rotation using rotors what is going to be if I have some vector V we're going to operate upon V in a two-sided fashion on the right hand side we're going to have e to the theta over two B hat B hat is the unit by vector in the plane and which you want to do the rotation theta is the angle through which you rotate and on the left because we're operating in a to side fashion we have the conjugate which is going to be minus theta over two times B hat so that's the rotor formula so the output vector I'll call V prime so this over here is four rotors now if you check on my quaternion videos or if you've studied this at all on your own if you were working in the equator nians you would treat V but V is now a quaternion it's not quite a vector even though you're artificially treating it as a vector again you're operating on V in a two sided way using quaternions now that's also going to be a two sided rule on the left hand side we're going to have a quaternion which is going to be e to the plus theta over two times and hat were n hat is the axis of rotation it's also going to be a unit vector the factor in quotes yet again because you're actually treating this as a quaternion none as a true factor in this in the geometric algebra sense of a vector and on the right we have the conjugate we have e to the minus today over 2 times n hat and the output vector over there would be V prime so this is what's going on in the attorney ins now you can see in terms of their form these formulas are quite similar they're both operating upon a vector vector in quotes over here in a two-sided fashion and the left and the right are sorts of conjugates of one another and that the arguments are being negated and I can write these two in a more compact white what I could do is call this thing this exponential on the left are as I have done at previous videos in which case the becomes this p prime is equal to R times P and then this thing because this is being defined as R this will actually be our dagger the reverse rotor or the conjugate if you prefer to think of it like that so this is the formula in geometric algebra using rotors and quaternions what I can do is call this exponential on the Left Q in which case the formed it becomes P prime is equal to Q V and because this is being defined as Q this exponential on the right is actually going to be the conjugate which I marked with a star as you sometimes do in complex numbers too and that's all for this video thanks for watching [Music] you