Visualizing Vector Operations in terms of Quaternion Multiplication (optional)
Transcript
welcome to a lesson with Dr Powell let's look at a little animation of what happens when we multiply to imaginary quad turnings together that means quadrons that have no real part um we're going to take one of these quaternions to have a length of one so that means when we look at its components suppose it's like a plus b i plus C J Plus d k then if you take a squared plus b squared plus c squared plus D Squared this and each square root that's the length of the quaternion and that'll be one now in this case actually there's no real part okay that's imaginary so it looks like this just the length in three dimensions so the length of three dimensional does that we see will have a length of one and that's where we're going to start now we're going to multiply in quaternion land we're going to multiply by the conjugate of u meaning we make the imaginary part negative well the whole thing is imaginary so we just take the negative of the whole thing so we're going to be multiplying by negative U H Thinking of U as being a quaternion and we can think of v as being a quaternity so we'd multiply by negative U and we're going to do it on the right side and that's actually important for quaternions because the multiplication is not commutative so I'm going to multiply it on the right and if we multiply U on the right actually what that does is it rotates things and it actually sends you down completely so it lies on the real axis so this is a little picture right here of imaginary Dimension so u and v in three dimensions are going to be a part but yet if we look at kind of a picture between imaginary dimensions in real and a real and a real axis in comparison um they would like both lie on the imaginary Dimension part if we're just thinking of the absolute values of these things and just kind of putting it in this demand this three dimensions into this one line this is kind of what we would see but this part right here is actually going to in the rotation is going to rotate down and going to be completely real and over here in this picture you won't even see it anymore in other words in three dimensions in the real part in the imaginary part this will be completely gone now what happens if we multiply negative U times V what's going to happen is going to rotate V in this rotation it's a four dimensional rotation we're going to lose some imaginary Dimension and you're going to gain some real dimension in there so so as V rotates itself we're going to um so uh you know V over here um it's going to lose some imaginary it's going to gain some real so we're actually kind of seeing this picture we'll actually see what happens with v we'll actually see the road um how it compares to imaginary versus real so it's going to be shorter than V here um as it rotates but it won't go to zero it'll still retain some imaginary Dimension here let's kind of see what happens all right let's let's go for it and then we'll watch this little animation here just second here um let's write so let's go let's go for it all right see what just happened let's repeat that okay so in this process um let's go again so it's rotating so see what happens as it goes comes here and as it rotates so this is they're rotating right and notice as they come out of so their main angles all the way in Imaginary Land but as we come down but as we rotate the angle becomes more and more visible as we compare imaginary to real in fact because U rotates all the way to be real and not imaginary anymore and um V okay so then as you compare it to V right here actually this angle right here is the same angle that we started with over here between u and v so we actually can visualize this Angle now as we compare imaginary to real we've kind of rotated the picture between V and U so we're actually comparing it via an imaginary to real comparison right here as it rotates down this is a four dimensional rotation so as you rotate you lose some in in the imaginary Dimensions but you gain a sufficient amount in the real part so that it actually maintains the same length overall as a quaternion or as a four-dimensional type of type object yet we can't visualize that so we we can look at the different components right we can kind of visualize what happens in three dimensions and we can visualize what's happening as we compare imaginary to real let's um take a look and kind of see what's happening here we can kind of rotate this animation our Viewpoint and see notice what V has done V has actually ended up being completely perpendicular or orthogonal to both u and v so the image of V so where V has actually landed in this rotation it's in this four dimensional this four-dimensional Rotation by multiplying by negative U um which has made put you completely on the real axis has actually brought V itself to be completely perpendicular to both um uh to both you and V itself um in fact we see in the process let's just run through this notice that U itself is rotating so the red is rotating 90 degrees or kind of it's an orthogonal um rotation in four dimensions so U has come down and rotated out and you know to this point and that seems rather orthogonal in fact this should make sense if you think about um the multiplication of quaternions so let's let's take a look at that for just a minute so we're multiplying by negative U and negative U is completely um imaginary so it's made up of something times I plus something times J plus something times K and you're multiplying it to a whole thing over here now let's just take this let's if we multiply it by this what is multiplication by I do that's an orthogonal rotation meaning a perpendicular rotation it kind of rotates everything by 90 degrees because it because to move the real axis from here to I kind of moves everything else in tandem or sequence around so that everything kind of is like 90 degrees from where it was before in some way but there's multiple ways of going 90 degrees in so many dimensions um as well as the same thing happens when you multiply this times all of that or this this times all that and then if you add if you add um orthogonal which means in multiple Dimensions it means perpendicular um uh maybe if you add these orthogonal results you're going to get something that's orthogonal you're all you're going to again get something that's orthogonal it's the original um and so the uh the outcome is going to be completely orthogonal um to where we started so V so this this guy right here is going to be 90 degrees exactly from where we started over here just like this guy right here completely real is actually 90 degrees away from where we started right here so this guy is is uh wrote is is um orthogonally 90 degrees away from uh this guy and now let's use an analogy to understand or at least to visualize um and computationally it's not too hard to see if you think about dot product and what it means to be orthogonal with that however let's just kind of think about a visualization conceptually um for uh why uh this guy right here right here should be orthogonal to this guy so why in the imaginary Dimensions is kind of the projection of this guy to the imaginary Dimension still orthogonal to this if we know that this guy right here is orthogonal to where it started right here it has to do with the idea that V itself originally was purely imaginary and we're going to use that idea let's suppose that we have a um a vector coming off of a plane so let's just think about a three-dimensional analogy okay so we have a plane and we have some Vector coming you know maybe starting here and going off the plane and then you know that it's perpendicular orthogonal to some Vector in the plane itself so maybe there's a right angle between Vector this Vector maybe that Vector which is maybe another one for visualization's sake okay so um yeah but just so you can kind of maybe just draw that again okay but anyways kind of Imagine um maybe kind of go like this so kind of think of a little plane section right here so this is a 90 degree angle between these two this is coming off that way in that way so that's kind of like what we have here because we have some Vector coming off of the imaginary dimensions um and it's going to be orthogonal to Something in the imaginary Dimensions this would be just like this is going to be orthogonal to something here in this plane now the question is then um if we take this guy and project it onto the plane so this Vector right here we project it onto the plane right here look at its part in the planet so it's just like taking this vector and projecting it to this part in the imaginary Dimensions this is the part of this in the imaginary Dimensions its projection under there notice in this picture that this guy is orthogonal to the original Vector just like this should be orthogonal to that guy well in three dimensions kind of um simple to see um because what's orthogonal to this is like there's a whole plane of things that are orthogonal to it and in order for this to be orthogonal in general it has to be in that plane and its projection is going to be a line which is perpendicular to this guy in the plane so the same basic analogy actually gives us that we know that this guy from an orthogonal operation is going to be orthogonal to the original um which uh which lies in all you know in these imaginary dimensions and um this is orthogonal to that it's projection onto there these imaginary Dimensions is all is going to be orthogonal to um uh to this guy as well this is this analogy now if you think about dot product if you accept the idea that if you if you take the dot product between two things meaning like if you have like a so suppose for instance you have like this Vector right here think of it as a quaternion um so in with four different parts A B C D and think about um okay and think about this guy right which is completely imaginary is having a zero real part maybe you have like an e f g happening here okay so things are orthogonal if when you take a if when we multiply the rest like downwards different components like this this times this plus that times that so we can write that out so a times 0 plus b times e plus c times f plus d times G okay so in order to make in order for this to be orthogonal this is zero well notice that this a times zero doesn't affect anything at all right which means that we have a DOT product of just these parts right here it's a slices for that to be zero so that's like okay in the imaginary Parts there needs to be an orthogonal condition the just and that half has to do because the original guy itself was zero in the real part okay so some analogies here but what we get is not only does you rotate to something 90 degrees over over from it which is from completely imaginary to something real but V will also rotate because it's a complete four-dimensional rotation everything kind of shifts the same way but we kind of talked about some ideas why why we can see that V also rotates and not only does is its part right here um 90 degrees orthogonal away from it the original but the projection itself and the imaginary part is also orthogonal to it so we get that the result of the quaternity multiplication if you project it into the imaginary part in The Imaginary Land here which is the three dimensions what we experience then the result is actually orthogonal to u and v let's take a look now and see how to represent this between cross product and Dot product okay so it's actually apparent in the animation itself notice here we've labeled these things now if we're considering U to actually be a unit unit Vector then um the this is like the length of U is just one so you can kind of ignore this part just think of this as U cross V if we assume U to be unit Vector you can just imagine this is just U cross face so maybe I'll write that up okay so you can just think of this as being um yeah for our sake we're just imagining that U has a unit length so just U cross V and uh you see what U cross V is it's actually the length of the projection of this guy V the image of V after the rotation um so this is after V has been rotated this is before V is rotated this is after so maybe like the after okay so if you take the after the rotation and you look at its um the absolute value or the length of the imaginary part that's what the cross products that's kind of what we're looking at the cross product in fact it's not just the absolute value it's actually the imaginary part itself it's the whole imaginary part because U cross V is a vector it actually lives here it's not just a number it's a it's actually a whole Vector so the projection as a vector itself into the imaginary Parts is the cross product the cross product will naturally be orthogonal to where we started at V and if you you can look at this both ways because um because if you reverse this like V times U versus U times V or whatever you do or if you have negative U on one side or the other whatever you do there you put V or whatnot um it actually just changes the sign and the direction but you still get that whether you do that you cross fee is actually going to be orthogonal um symmetrically um to V and U to both of them okay so um that's what the cross product is it's just the imaginary part just the imaginary part of the after effect of the rotation you just project in the imaginary dimensions and that is the crossback now what's the dot product the dot product you don't even see over here in three dimensions and the reason why is because it's real it's sitting over here the dot product is actually and so it's just a number now because we're just considering as a real number a scalar this is kind of like a scalar axis so scalars are like the fourth dimension but you don't see or visualize them because we're sticking on the three-dimensional imaginary part over here but um it's actually the projection the action and you can even think of it as a vector projection if you think about a real number as being a or a scalar is being a vector um onto the um onto the real axis here of the after effect of V after the rotation so U dot V is going to be this part and um and U cross V is going to be this part coming up and down um okay so what we end up getting is kind of a neat idea is that if we allow ourselves to pop over into imaginary Dimensions we actually um are unreal and a real Dimension with a real Dimension then we get a nice triangle where we have U dot V for a length over here and a length over here so you so you see this red this red is actually just the image of U after the rotation it's in the same line as it relaxes but it it's not the same thing as the projection of of the after effect of V the projection of after effectivity is actually this whole bit from here to here so it's actually a little bit bigger so you can kind of ignore that red if you want it comes all the way out to here that's what U dot V is a new cross V is going up and down so so we actually get um hold on U cross B so you cross V is this part U dot V is that and we have a triangle you could even use this triangle if you wanted to to analyze the angle right here but usually when we're finding angles we don't really think about the cross product here we just use dot product because we already have this length we just take the length of the vector to begin with because this is really um just the after effectivity and if you want to just think of length you could just think of length there you could just think of the length of these things if you want in a triangle you can use a cosine right here and you could you can get the angle very nicely of between the two vectors because we've all we've done is we've four dimensionally rotated this so that we're kind of in this position over here and um we can we can have the the different lengths so I hope this little visualization and animation helped a little bit in understanding what quaternions do when we multiply by with them and how they relate to Vector operations the dot product and the cross product thanks for watching