Set Theory (Part 14b): Quaternions and 3D Rotations
Transcript
in this supplementary video I'd like to continue our discussion of number systems by introducing you guys to a very cool four-dimensional number system called the querian as a review of what we did last time what we did is construct the set of complex numbers from the set of real numbers simply by taking ordered pairs of real numbers and then setting up addition and multiplication operations and what we discovered When We examined complex number complex number multiplication is that this operation very nicely encodes rotations in two dimensions a very natural question to ask at this point is is there a is there another number system which will take care of rotations in three dimensions and the primary name associated with this so-called rotational problem is William Hamilton uh this is the same Hamilton who got his name on the hamiltonian operator in physics his primary insight is that instead of considering threedimensional numbers that would be the most natural answer we had a two-dimensional vector and the complex numbers taking care of two dimensional rotations so why not consider a threedimensional vector taking care of threedimensional rotations his Insight was that we should consider not three-dimensional numbers but four-dimensional numbers that is we're going to consider objects within R4 and instead of having one imaginary unit which would be I and the complex numbers we should have three imaginary units i j and k now remember in the complex numbers the fundamental equation with I was that i^2 be equal to minus one and Hamilton's Insight was that these three imaginary units should be related in the following way that i^ s J2 and k s very similar to the complex numbers these should be equal to minus one and furthermore this is additional relation that j j k should also be equal to minus1 and this is really the fundamental equation which is going to set up querian multiplication now uh what did these numbers look like well the complex numbers were written in the form a plus bi where we had some real part here we call this the real part and then the imaginary part here just a plus b i or an order par notation just AB now the quarians are going to have four parts to them we still have these coefficients a b c but now we have D because we're now we're doing a four dimensional Vector here we have these three imaginary Parts here whose coefficients are b c and d and we have this so-called scalar part and physics one often says that this is the scalar part and then this coupling of BC and D is a vector part but here we can see this is an uh ordered for Tuple or ordered quadruple so this is going to be the primary way that we're going to write the Quan as an ordered quadruple as with the definition of the complex numbers the definition for the set of querian which we're going to denote by the capital H H standing for Hamilton is quite simple in fact what we're going to do is just pick out any four real numbers and then form a ordered quadruple from them so what we're doing is we're selecting members from R * R * R * R where the times just means cartisian product and again we often denote this as R4 just as complex numbers were R2 the set of querian is going to be R4 so definition is quite simple and as I said before we may often convert between notations for complex numbers instead of writing one two I might denote this as 1 plus 2 I in vice versa I might write 1 plus 2 I but we might write this as one two as well for the querian we might go back and forth between writing 1 2 3 4 as an ordered quadruple and writing 1 + 2 I + 3 j+ 4 K and again this first uh entry here the one is often called the scaler part and then this order triple consisting of the last three entries is is sometimes called the vector part and as with the complex numbers we set up the definition of what the set is and now let's uh consider the algebra behind uh Computing with querian now let's start with querian addition now addition is going to be fairly simple and it's just like the complex numbers this is going to be simple vector addition adding component yse that is if I have two querian let's say I have 1 2 3 4 or 1 + 2 I Plus 3 J + 4K and I have another querium which is going to be 011 or just J plus K I add component wise I add the scalar parts to each other so I get one plus 0 that's one I add the I together that's 2 plus 0 is two add the J's 3+ 1 is four and then the K's four plus 1 is five so you just add like you would normally add vectors and then General if I had two querian let's say a BC d and another one efgh then just adding the components I get the third Quan the output quaran is AE bf b plus f c plus G and D plus h so just simple vector addition and just to put this once more in notation in the order quadruple notation I have ABCD and efgh and the result of querian addition is going to be a plus e b plus s f c plus G and D plus h quite simple and as before we want to examine some of the algebraic properties we see that querian addition is closed when I add two querian I produce another querian and just like complex number addition quater addition is commutative and associative and these are very easily proven uh what is the additive identity for the quater so again I'm looking for the querian such that when it's added to some other querian let's say ABCD what I get out of that is ABCD and that's pretty obviously going to be this quaternium the zero quater which is going to be 0000 Z and also the additive inverse here I'm looking for the querian such that when it's added to let's say ABCD gives me the additive identity or 0000 0 and here that's just going to be the negation of ABC c d where I negate all the components so the additive inverse of a c d is just minus Aus B minus cus D so now let's set up quaternium multiplication and we're going to take a similar strategy as we did with the complex numbers for the complex numbers we just multiplied a plus b i with some other complex number c plus di in the usual way and then we just used that algebraic property that i^2 should be equal to minus one to discover how to to multiply complex numbers now we're going to do the same thing with querian but when we do this when we distribute we're going to start to get terms like i j j * i k * I and a few other possibilities so we're going to need to know what to do with i j and ji and so on and just as we used for the complex numbers we used i^ 2al minus one the fundamental equation that we're going to use in terms of setting out the algebra is this one this fundamental equation of quorans so what we're going to set up just to keep this clean is we're going to set up a multiplication table between IG and K where on this column here is going to be the symbol on the left hand side and on the row it's going to be a symbol on the right hand side for example if I want to look up what i j is I look up I and I go over to J here so when I discover what i j is I'm going to write that here and if I want to know what ji is I go to J and then I here and I'm going to write that there so what we need to do is fill out this multiplication table and just from the fundamental equation that i^ s j s and K squ should all be minus one I've already written minus one on this diagonal here and the equation that's going to allow us to discover what the remaining entries are is going to be this one JK equals minus one so let's derive the remaining entries on this table down below I've completed this multiplication table but we're going to go through each of the remaining six cases to show you why it is that for example I J is going to be equal to K and so on so the rest of the six entries are going to be derived just by playing around with this equation i j k is equal to minus one and one additional note before we get started with the derivations is that we have to be extremely careful to not commute because we don't yet know that queria multiplication is commutative and in fact is going to turn out that it's not commu so we have to be careful with that so we're going to start with IG K is equal to minus one what I'm going to do here is multiply on the right by K so I'm going to get i j k^2 is equal to minus k then since k^2 is minus one I get minus i j is equal to minus K which says that I is is equal to K and then let's derve another one now I'm going to take this equation I'm going to multiply on the left by I so I'm going to get I2 J is equ Al to i k again I2 is equal to- 1 so I get minus J is equal to i k so that gives me that entry right there that ik is equal to minus J and let's drive another one so we start with i JK is equal to minus one now I'm going to multiply on the left by I so I get i s JK is equal to minus i i s is minus one again so minus J K is equal to minus I so that tells me that JK is equal to I so that gives me that one there so I've already completed this upper triangular portion of the table and then we've got three more to derive so now I'm going to start with JK is equal to I I'm going to multiply left by J so I get j^2 K is equal to j i j s is equal to minus one so I get minus K is equal to ji so ji is equal to minus K and uh one observation we can make already is that we notice that JJ is equal to K notice that when we commute those two we get the opposite of that one I J is equal to K and now ji the commuted version is equal to minus K and just as a spoil alert this is going to appear for the rest of them but let's continue with this uh we start with ji is equal to minus K what we just derived we're going to multiply on the right by I so I have J i^ 2 is equal to minus k i which gives me minus J is equal to minus Ki or J is equal to KI so where's that Ki is equal to J and just as before when we commute we discovered before that I K is equal to minus J and we found here that Ki is equal to J again we have that observation that when we commute we can just add the minus sign while we're working with with these three imaginary units and the last one we start with Ki is equal to J we multiply on the left by K so I get k^2 IAL KJ K squ is minus one so I get minus I is equal to KJ so it gives me that last entry here and again I see that the KJ is minus I and over here I dve the JK the commuted version is equal to I so this is the completed version for working with these imaginary units and really only you notice that let's say you really had to memorize these things you really only to need to know uh three of them and then remember that when you switch the order you just add a minus sign so what You' have to know is that I * J is equal to K uh a nice one to know is that k i is equal to J and then the J K is I those are the positive ones now when you switch to order then you just add a negative sign before continuing I'd like to make one observation uh related to how physicists treat these units i j and k now if you've taken physics you might instinctually associate i j and k to the X Y and Z directions and historically this is how it is it was all set up through plans and you may also realize that if you do that if I associate I to the X Direction and let's say J to the Y Direction then I times J being equal to K the Z direction is very very similar to saying that X cross y taking the cross product between the unit X Direction and the unit y direction gives me the unit Z Direction so if you've seen any physics this is actually very much tied in to the cross product operator that when you do something like I J when you do X cross y you get Z and if you flip that order if you do y cross X you get Negative Z and continuing with the other uh unit directions if you take let's say J * K which would be similar to saying y cross Z you get X and historically this is really where the cross product comes from it's not so much that we see this and we interpret it as a cross product we we don't say that this is a special case of the cross product historically what happens is that querian operations were developed and then we sort of abstract the cross product from these particular operations so that's just one interesting note if you're interested in uh physics now that we know what to do when multiplying these Imaging units and we have the multiplication table uh we're now prepared to set up queria multiplication so I'm going to do precisely what I suggested before I have two querian ABC D and efgh and I'm going to just multiply them just distribute all the stuff now as a warning uh the next few minutes are going to be quite messy in terms of Distributing all this stuff but after we get through the mess we're going to clean it up quite quickly so you should just uh to stick through with this stuff so first I'm going to distribute the a to all these terms here so I get AE plus AI plus agj plus ah K as my first collection of four terms and just for clarity I I write and bold these imaginary units and I'm going to take the bi I'm going to distribute all this stuff here so I get Bei plus BF I 2 plus BG i j plus BH i k and I distribute the CJ to all these four and I get the following and I don't have to read that to you you can read that yourself and then lastly I distribute the DK to each of these four elements and I get the following and notice now I'm getting these products of imaginary units like i j and JK and KJ but I now know what to do with these and I'm going to simplify these Expressions line by line so let me deal with this first line and you notice there's nothing we can really do we just have I JS and case here let's move on to the second line here I notice I have an I squ so I just replace that with a minus one the i j gets replaced with a k i k goes to minus J and then the coefficients are unchanged except if you put a negative sign the third line J goes to J ji goes to minus K j^2 goes to minus one JK goes to I and then the fourth line uh k K is unchanged Ki goes to J KJ goes to minus I and K goes to minus one and that really completes the simplification now what I'm going to do is group all the common uh elements together first I group all the scalar elements together so I'm going to group a e with minus BF minus CG and minus DH I'm going to write that here as the first element of my new querian and then I group all the stuff an i within so I'm going to group that with that that and that and then I group The JS together be one two three four terms and then the case together so I have one two three four terms there so I just group all this stuff together that has that imaginary unit in common and now I finally Define What's called the Hamilton product which is precisely what we've done had the Hamilton product is just the quaternium multiplication that the quaternium product between ABCD and efgh is going to be the following and that's precisely what I just derived in the previous slide where this is going to be the scaler part here this is going to be the I component the J component and then the K component here and this is really as messy as it gets and it's really not much messier than let's say if you if you know anything about the cross product is really not much Messier now that we've defined quaternium multiplication or the Hamilton product let's clean this up a bit so that we can very nicely do computations with Quan in fact what we're going to do is we're going to set up a matrix which is going to correspond to a querian and that's really what's going to keep this these computations clean so what I'm going to do is I've written each of these four components of the new querian in such a way as to have some coefficient times e something times F something times G and then something times H in that order I have EF g e f g and efgh now let me write that vertically so this first line here is going to be just that first component of the new quarteron and then I'm going to write the second third and fourth below it and notice that all the e line up in a column FS line up the G's line up and the H's all line up so I've just commuted all of the stuff prely the result of that querian multip that Quan multiplication between ABCD and efgh so let's say you had to really memorize something in my opinion it would be the best idea to memorize this Matrix here instead of M remembering all these different combinations of A's and E and D's and G's this is just a mess here but this Matrix is actually very symmetric and this is actually very easy to memorize if you were forced to do something like this so for the rest of this video we're really going to work with analyzing the properties of this Matrix now quter multiplication isn't usually presented in this fashion but in my opinion this is much easier to analyze because a lot of questions about quarians and multiplication of quarians just become questions about multiplying matrices in the case of quan these are very special for 4x4 matrices and these are much easier to analyze in my opinion and notice that this 4x4 Matrix is quite special looking because this real component the so-called real or the scalar component is right along this diagonal here all these A's are along the diagonal and furthermore that if I take some element here let's say in this triangle here in the upper triangular portion that when I flip it over the diagonal I I just have to negate that entry to get the corresponding entry here for example if I take this minus C here and I reflect over the diagonal it's just C over here or if I take this C over here I reflect over diagonal it becomes minus C so this Matrix is almost what we call skew symmetric which means that when we flip stuff over the diagonal that's the same thing as negating it but it's not quite SK symmetric because the diagonal entries here are non zero but this Matrix is very very symmetric it's very very easy to remember as comp as opposed to this nasty formula here as with addition let's talk a little bit about the algebraic properties of quaternium multiplication now we've seen that quum multiplication is not commutative that is uh we've seen many counter examples already we saw that IJ is certainly not equal to ji and in general quat multiplication will not commute if you pick uh other querian to multiply for the same reason that matrix multiplication is almost never commutative however just like matrix multiplication quaternium multiplication is always associative and it's always distributive and what's nice about thinking of querian in terms of 4x4 matrices is that if you want to prove these You just prove that you can represent querian in terms of matrices and then prove the corresponding claim for matrices we already know that Matrix multiplication in when it's defined in the conventional way is associative and it's distributive that is if I have three Quan q1 Q2 Q3 uh it doesn't matter if I do q1 Q2 first and then multiply on the right by Q3 or if I do Q2 Q3 first and then multiply on the left by q1 so it's associative and for the distributive property let's say I had q1 times the sum of Q2 Q3 that's equal to q1 Q2 plus q1 Q3 now now just to emphasize that we cannot commute let's suppose I had Q2 plus Q3 then multiplied by q1 on the right now it's absolutely essential that when you distribute this that you write it as Q2 q1 plus Q3 q1 that you keep these orders the same that Q2 is on the left q1 is on the right you can't just swap these like this because querian multiplication is not commu and furthermore we can examine what the multiplic identity and what the multiplicative inverses are now the multiplicative identity is quite simple now that we're thinking of matrices what's the multiplicative identity in terms of matrices well say this Matrix over here where the ones are all along the diagonal here this is the 4x4 identity Matrix and we know that when I multiply by this Matrix on the left or on the right when I multiply that by any arbitrary queral which is what I've written here and here then I get the same thing back back out now the question is what querian does this Matrix correspond to well if I just look at the formula for the Matrix representation of a querian the A's are all along the diagonal so a is going to be equal to one then everything else the B's C's and D's are going to be equal to zero so this is just the this identity Matrix is just the Matrix representation of the querian 1 0 0 so this is the multiplicative identity for querian very similar to complex numbers as well we already discovered in the complex numbers that one Z was a multiplicative identity so we're seeing a lot of nice symmetries between the complex numbers and the querian now continuing with this Matrix interpretation of querian let's say I had some quatran ABC D and I were interested in its multiplicative inverse so if I have some Quan ABCD the following this is just that formula would be the Matrix representation of ABCD so what does it mean to find the multiplicative inverse of this Matrix we're looking for the Matrix such as one one is multiplied by this Matrix gives me the identity Matrix and this is the same thing as asking what is the inverse of this 4x4 Matrix so if I can find the inverse of this Matrix that will be the inverse querian of ABCD and this Matrix is quite remarkable when you actually take the inverse um for example if you calculate the determinant of this Matrix you'll find that's actually a very very nice quantity and I won't spoil it for you if you want to actually compute what this determinant is it's actually a very nice symmetric relation between a b c and d but when you invert this Matrix I'll give you the result of the computation when you invert this Matrix you're going to find that when you convert it back to the four Vector representation you'll find that Q inverse is going to be a over the sum of squares of ABC and D minus B over the sum of squares minus C over the sum of squares and then minus D over the sum of squares and notice again this is very very similar to what we're seeing with complex numbers in terms of taking inverses and notice two that if you have noticed this already when we're dealing with complex numbers is that the sum of squares thing that we're seeing in the denominator is not at all arbitrary because we know that the squared length of Q is precisely the sum of squares which means that the length of this Quan is going to be the square root of the sum of squares of ABC and D so these denominators here are simply the sum of squares of the uh quum and furthermore for the complex numbers if we had some complex number AB its conjugate is going to be a minus B we just negate that imaginary component now since for querian we have three imaginary components we're going to define the conjugate as a minus B minus C minus D and also it's very natural to Define it in this way because when we Define these two objects in this way we can very nicely write Q inverse as this quantity the conjugate of Q divided by the squared length of Q just scaled down by the squared length of Q and that's precisely what we have here and notice that in the special case when Q is of unit length when Q has a length of one that means that the square length is going to be one in that special case where the querian is of unit length the inverse and conjugate are the same thing now that we've set the preliminaries behind querian calculations we can now talk about why querian are interesting in that they encode threedimensional rotations through any axis that we want and through any angle that we want now the fundamental formula for querian rotations is the following what I call the Quan rotation formula which says that if Fe is some function what I call which I call F subq this this is going to be some rotation function associated with a quan q and it input is going to be some vector v the querian that comes out of that function is QV Q inverse and I make the additional restriction that this Q the associated querian is a unit querian that is it's going to be of length one now since it's of length one instead of Q inverse I could just as easily write qvq bar where qar is that conjugate and now when I want to rotate about some axis and about some angle it's just a matter of picking which unit Quan will do that job so that's really what we're going to talk about for the next few minutes and uh usually I like to motivate where formulas come from just like I wanted to motivate where the Hamilton product really comes from what what what the insight was behind it and what the derivation is unfortunately here I can't really think of a good motivation for why the formula is this way it certainly is the case that this formula does rotations but I haven't really come up with a good motivation for it yet but it turns out that this is going to be the rotation formula for quater now let's uh let's play around with this formula a little bit let's say I pick K as that unit querian and I associate the the following rotation function f subk and I'm going to input some vector v so that means that the rotation formula is going to be KV K inverse now K inverse is just minus K so the rotation formula is going to be minus k v k and let's examine what that does to our coordinate system now let's use the physics interpretation of IG and K where I is going to represent ver it's always going to represent 0 1 0 0 but it's going to represent the X Direction J is going to be 0 0 1 0 and that's going to represent the y direction and then K is going to represent the Z Direction so what we're going to do is we're going to apply this function f subk to each one of these basis pteran and then we're going to examine what the output of that operation is that is to say what are these three quantities F subk of i f subk of J and F subk of K so you can imagine this as inputting the x axis so I is going to represent the uh x axis in three dimensions so we're wondering what does this function do to the x-axis and then here this would correspond to what does this function do to the y- axis and then finally what does this function do to the z-axis so we're imagining not just rotating individual vectors but it rotating the entire coordinate system and we're going to see what the output of these fees are going to be so let's first compute F sub K of I so I just plug that into the rotation formula so I get minus k i k uh doesn't matter which way you do this in you can do um Ki that's going to be equal to J so that becomes negative J K JK is equal to I so I get negative I as a result of that so that means that I the unit ACC Direction gets sent to the negative X Direction okay that's our first result F sub K of J the unit y AIS or the unit y direction we just plugg into the formula it's going to be negative k j k and now I get KJ is equal to minus I so now I have i k then I K is equal to minus J because remember Ki is equal to J so ik K is going to be minus J so what do I get here I get J gets sent or gets mapped to minus J so it's pretty interesting so far the x-axis gets sent to the negative x-axis the y- axis gets sent to the negative y- axis so what happens with K so again I just plug K into this formula and what I'm going to get is K cubed so k^2 isus one so I just get negative negative K or just K so that means that K is is mapped to K which means that the unit Z direction is unchanged by this operator so the Z direction is the only AIS which is not changed by this operator and if you can visually think about what's going on here the unit x-axis is getting rotated around to become the new minus x-axis this J Direction the Y Direction gets rotated 180 degrees around to its negative but the K is preserved so that means that we're rotating through the Z axis since if you can imagine rotating this entire coordinate system rotating about the z- axis will preserve the z-axis it won't change that Z Direction so what is this operation F subk doing is rotating the entire coordinate system 180 degre about the z- AIS so this is a pretty significant result and I encourage you to visual this see what's going on with this Fe sub K and understand why this is a rotation as opposed to just being a reflection we've taken care of a very simple rotation one about the z-axis 180° but what about more difficult rotations this is really where the power of quernus is going to be manifest because even if you're very visually talented if you can imagine these things in your head it's in a precise sense it's very very difficult to visualize the rotation of an entire coordinate system if you pick difficult enough axes and it's actually very difficult to set up even geometrically so let me present how we're going to find the correct unit Quan for rotating about some arbitrary axis some arbitrary amount of degrees so it turns out that if U is some unit Vector in three dimensions let me call it U X uy U for example this might be 221 111 we're actually use the example of 111 and a second it could be anything you want some three vector and it's a unit vector and suppose I want to rotate about that axis Theta degrees it turns out that the correct unit quadion to pick Q is going to have the following four components the first component the scalar component is going to be the cosine of theta over 2 de the second component the I component is going to be that ux is going to be the X component of that axis Vector multiplied by S of theta 2 and then the remaining components are similar the J component is going to be u suby multip s of theta / 2 and the fourth component U subz is going to be multiplied by S of theta 2 as well and in fact if if you pick a unit Vector If U is already a unit Vector that even when you multiply by these cosines and SS then you're still going to produce a unit querian that you don't have to worry about checking the length anymore and this will be clear through an example for example let's consider the rotation about the 111 axis so I imagine that Vector in three dimensions 111 that axis through 120° this is actually going to be a very interesting rotation but you can see in a if you're very visually talented it's very very difficult to imagine any arbitrary rotation through this axis in a very precise sense sure you can imagine rotating a sphere but if I asked you can you estimate where such and such Vector is going to be that's actually a very difficult question so this is why quatern are extremely powerful so we're going to rotate about 111 now first we notice that this is not a unit Vector because the squared length is going to be three so length is going to beun 3 so what we're going to do is first create the corresponding unit Vector U just by scaling it back down by of 3 so we're going to consider the unit vector 1k3 1k3 and 1k3 same direction just scaled down and now we're going to find the correct unit Quan just by using this formula so it's 120° so thet over two is going to be 60° so that means the first component is going to be the cosine of 60 which is 12 the second component is going to be 1 < tk3 * the S of 60 so it's going to be 1k3 * < tk3 over2 so it's going to be2 and then the other ones are also 1/2 so it turns out that the quaternium the unit quter we're going to select to do this job of rotating about 111 through 120 degrees is going to be the following quaternium 1 half one half one half one half and now what do we do we just plug it in to the corresponding rotation function we do that QV Q inverse operation so here I have q multiplying out on the left I have some arbitrary input Vector let's say A B C D and then I multiply on the right by the conjugate or the inverse of Q now let me make a quick note about doing this sort of computation uh in the previous example I was considering rotating the entire coordinate system I was considering rotating the X Y and Z directions but let's say I was just interested in one particular uh Vector to rotate let's say I wanted to do this operation this precise rotation with the vector let's say one0 0 which also happens to be the unit X Direction what I do for this querian in terms of which Quan I plug into this formula I just plug in 0 1 0 0 and this is why this is called the Vector part because when you put three dimensions into the fourth dimension you just stick it into the vector part so if I wanted to rotate one0 0 using this operation I would just input the querian 01 0 0 and then whatever comes out of that I just look at the last three components just the vector part and you sort of ignore that scalar part so this is how you would probably do this in Practical applications in terms of inputs and outputs you're really only concerned with the vector part and this will become clear as we do the computations as with the last example we want to consider what this rotation does upon the entire coordinate system not just individual vectors but the entire coordinate system so what we're going to do is just do precisely this computation qvq inverse or QV Q Bar first I'm going to consider what is uh F subq of what does this rotation do to the x axis and when we do these computations this is really where we're going to see the matrix multiplication is really going to clean things up so what I'm going to do is I want to First do this operation Q * I so how am I going to do this computation I'm first going to create the 4x4 Matrix corresponding to q and to do that you just plug it into that formula involving the a b c's and D's as before and it turns out that the 4x4 Matrix corresponding to that quaran 12 12 12 12 is the following 4x4 Matrix now I want to know what querian results from doing Q * I so I take that 4x4 Matrix and I multiply on the right by a 4x1 Vector which is going to encode I and that's precisely the vector 0 1 0 0 and what I get out of that is some other Quan namely one negative one22 12 negative2 so that's just and this is just ordinary matrix multiplication which is why it's nice and clean so when I multiply on the right by I that's the same thing here is looking at the second column of this Matrix so that's why I get this as a result so now I have the result to doing Q * I but now I want to multiply on the right by Q inverse so what I'm going to need to do is take this Quan that I got out convert it to its 4x4 Matrix representative again just plugging into that formula for finding what Matrix corresponds to this quum and then I'm going to multiply on the right by Q inverse represented as a four dimensional Vector okay so Q inverse as this Vector is going to be one2 and just negating the other three so I get Negative one2 1/22 and on the left here I have the 4x4 Matrix corresponding to this intermediate quter in here and then I want to do this Matrix times this Vector what do I get out of that I get a very nice result 0 0 1 0 and what is that also known as 0 1 0 that's precisely J so this rotation takes the xaxis and rotates it to overlap with the y AIS so I get sent to J and if you continue doing this sort of computation which I encourage you to practice with what you're going to find is that F subq of J the unit y Direction gets sent to K and then K gets sent to I so you can see that these axes are being shuffled around they're being cycled around I goes to J J goes to K and K goes to I and this is actually a very very nice rotation just because it's cycling these axes around like this and since I know what this rotation does to each of the basis vectors I can now say what any arbitrary input Vector will be outputed as so let's say I have some querian ABCD that gets inputed to F sub Q I can now say that the output of that is going to be if the input is ABC D the output is going to be a d b c now why is that because the X component right there that b is going to be sent to the Y component so that means that b is going to be placed right there in that y component or the so-called J component now since J gets sent to K that means the C is going to go over here in the Z component or the K component then the K that D is going to go in that remaining slot and the a in is going to be unchanged now going back to what I was saying before suppose I were just interested in one particular Vector in three dimensions let's say one two 3 in terms of querian what I do is I input that as a as a querian letting that first component be equal to zero so I input that querian as 0 1 2 3 into Fe and I just do the following flip-flopping of uh of numbers here and the output of that is going to be 0 the Quan 0 312 now what that means is that if I take the unit if I take the vector 1 2 3 I do this oper I do this entire operation I rotate about 111 120 degrees the vector that comes out of that is the vector 312 again I'm just looking at those last three components so this is the very very nice result that I can do these sorts of computations very quickly or I should say the computations are very easily done once you develop the fundamentals behind doing this and You' set up all this Matrix arithmetic now let me close out this video by making a few Historical Notes and sort of talking about how querian Math Connects to Modern Vector operations now we modern students of math and physics when we learn about Vector operations the fundamental operations that we really learn about are the dot product and the cross product between vectors now historically speaking these operations come out of quatum math quatum math is really the the more fundamental object and in fact quat multiplication can be defined in terms of dot product and cross products or vice versa you can Define what a a do product or what a cross product is in terms of quum multiplication and let me make that a bit clear let's say we had two querian q1 and Q2 now q1 instead of writing this as a four component Vector I'm going to write it as a or as an ordered pair where this first one is going to be the scalar part this just the ordinary first component of the Quan and then this object V1 is going to be a three-dimensional Vector so here I'm actually capturing or I'm making it very explicit what I mean by scalar part and Vector part so in terms of potteran the first first component is going to be W1 and then the remaining three components are going to be contained within V1 so this is just a different way of writing quarians and then similarly for Q2 and you can actually show that q1 * Q2 where this is just the ordinary quum multiplication can be written in the following way and another very interesting way that the first that the new scaler part that you're going to get out of your querian q1 Q2 is going to be given by W1 W2 and these are this is just ordinary scalar multiplication minus the dot product between V1 and V2 remember V1 and V2 are going to be themselves threedimensional vectors so you then take the dot product between these two and that whole thing becomes your new scalar component and then your new Vector component those remaining three components that's going to be given by the following W1 * V2 so this this is just scaling up a vector it's just scaling up V2 by W1 plus W2 V1 so this is just scaling V1 by W2 and then you add another Vector you add the cross product between V1 and V2 and remember the cross product is not commutative so you have to make sure that when you're talking about q1 Q2 that you have to write V1 cross V2 in fact the cross prodct is anti-com it's even better than quter multiplication in some sense and I encourage you to verify that formula in terms of seeing that this is indeed the same as quaternium multiplication in terms of how we set it up in this video now notice in the special case where W1 and W2 are set equal to zero which is kind of how they're normally done where you're you're using Quan in the setting of threedimensional space you set W1 W2 equal to zero so q1 is going to be equal to 0 V1 Q2 is going to be 0 V2 that when I do q1 Q2 the output Vector is pretty interesting so the V every time I see a V1 or sorry a W1 or W2 that goes to zero so what I'm left with in the scalar part is the negative dot product of V1 and V2 and then when I examine the vector part W1 and W2 are zero so what I'm left with is the cross product between V1 and V2 so if you had two two vectors in three dimensions you could interpret those as two querian where the scalar part is set to zero and then when you do q1 * Q2 the thing that results uh is going to be in the scalar part is going to be the negative do product between the two and then the vector part is going to be the cross product between V1 and V2 so that's pretty interesting too so I encourage you to play around with that if you're interested in that just to take an example of that let's let's say just precisely what I was saying I had two vectors in three dimensions let's say V1 is 111 and V2 is 321 so I load those two up as querian so now q1 is going to be I'm going to put a zero there and I just write the vector part like that 111 then Q2 is going to be 0 321 want to do ordinary quaternium multiplication and you can do it my Matrix way you can do it the other way using that wacky formula q1 Q2 is going to be the following Quan -6 -1 2 1 so the Scala part is going to be - 6 and the vector part is going to be1 to negative 1 so what that means is that the dotproduct between V1 and V2 is six and you can see that that's quite obvious 1 * 3 is 3 + 2+ 1 that gives me six so that makes sense and what that means is that the cross product V1 cross V2 is1 to negative 1 and this is really historically where the cross TR and DPR come from so that'll wrap up this video hopefully you've enjoyed this discussion and this introduction to querian and this video is a bit longer than my other ones but I figured it's important to go over both the theoretical foundation and also the applied aspect of querian because if you do one or the other then it's kind of uh you're missing something if if you're doing just the applied stuff if you're thinking like a physicist or an engineer then you really don't know where this stuff is coming from you really have no understanding of why this works at all and if you do just the theoretical stuff then you know like a lot of other areas of pure math you're left wondering who gives a so hopefully you've enjoyed this video stay tuned for my other videos and uh perhaps I'll do a whole series on querian who knows so thanks for watching