Quaternion lecture, June 27, Part 4/6

Channel: Amanda Stowers Published: 2013-06-28 2,933 words Source: auto_caption
Advanced Mathematics & Geometric Physics

Transcript

is inventing these and this is the order perimeters e0 E1 E2 E3 and in the context of what we're doing these are not independent of each other it turns out that they're related the constraint between them is that e0 2 + E1 2 + E2 2 plus e32 = 1 all right so this is a constraint between them they are not three free independent variables they are related by this and we'll explain how this actually shows up in the rotation Matrix in a second and where this comes from when you're doing integration it's not uncommon for um for you to What's called renormalize the order parameters and it's pretty easy to do what you do is you um you start off with e0 E1 E2 E3 equal to whatever it doesn't really matter and you reset e0 along the way um and what you'll do is you'll say e0 is equal to e0 Old divided by e0 old 2 + E1 old s + E2 so we do this a lot where we'll take this sum which might not be one Okay this may be equal to for example 1.2 so this bottom thing should be one it's not so we say well how do we go back and give me this constraint to be renormalized what you do is you reset e0 to be whatever e0 was and divide by this thing squared so that's renormalizing and so it's such an easy thing to do to say if this isn't staying one don't worry it's really easy to fix it and to make it go back to renormalize to all right so that's that's sort of the history of them this is how they relate and then you'll hear people talk about kerans a lot but in terms of our usefulness of them this is a huge field it like I said dominated a mathematical landscape and then people finally realize you know what vectors own the own the G really own the game what do you really need to know you need to know a tiny subset of cians called where the parameters and so when people talk about katrinians they usually talk about other parameters but they're slightly different it's like saying the parameters of these things the Quan is the whole thing and then you can do all kinds of querian algebra which you don't need to know all right so that's what we're going to do so as a second methodology for doing 3D we're going to do um cians otherwise known as or the parameters the advantage um really is literally avoid Singularity that's your why you care so much the disadvantage it's it's even more mathematical okay it's it is in la la land so it's la la math all right there's no there's nothing physical about nothing so when people say what does it mean it means nothing it to change of variables it is a pure pure math pure math game all right but in order to get the querian there's one more thing one of the let's call it method for doing rotation so these are all by the way these are all about uh so there one more set um this is all about rotations so the last set is um what we call axis angle all right and it its Advantage is it's super physical easy to completely easy to understand and it's the gateway to or the parameters for turn so that's what's great about this the complete disadvantage is um here the singularities are uh I'll say at 90° these have sing singularities even a worst place Z degrees okay so like you can't even start with these things so they're pretty much useless when you relate them to angular velocity but they're the gateway to these things and they're really easy to get a hold of so first let's talk about the axis angle then we'll talk about the pan and then we're take stop all right so I want to first talk about axis angle so in your books um you have a this is chapter nine in your books anyone's hungry there's a leftover stuff in my La Barbecue that you can hold yourselves to so thank you for bringing us in I'll help you after there's plenty left so um we're going to start chapter actually 8 uh so five chapter 8 and so one way to do General orientation is to use three angles that was the real Pit offw so you can say I'd like to be able to orient this any way I want and you can think at this also as a piece is moving down the assembly line the piece is moving down the assembly line it's on the assembly line it's going that way and all of a sudden you say well in order for me to make my next drill or next move on this thing or fill it up with whatever it needs to be filled with you have actually have to change the orientation of it so it's coming down the assembly line you decide you have to actually get it to look like this and you can do it by doing three things you can actually have three pieces of equipment one that do does a rotation one way one does a rotation another way one does a rotation another way so you can build three pieces of equip or you could say to yourself is there a way for me to be really clever and find the right Axis to do the rotation about and if I do the rotation about the right Axis I could just do one piece of equipment move and that's what we're actually going to do and that's called a single axis angle rotation so this is called a um we call this a simple beta Lambda rotation and of course who came up with the math to this it isiler Oiler of course you did everything thing um and so what he said is uh here's what you do if you want to do a reorientation um uh here's the math to it I mean the math is in the book it's very mathematical um but I'll just give you what happens if you if um to start this y z so here's a set of three unit vectors and then here's an object B and inside of B initially aligned with a is BX is this way b y is up and bz is up so we start with b initially aligned with a and if you'd say um I could rotate first around BX say okay great I know you've been doing that all quarter you're like okay if you rotate around BX I know exactly how to handle this if you rotate Just Around by I know how to handle this or I rotate around bz I know how to handle this however sometimes you want to rotate around some combination of BX b y bz and we talk about that combination being unit Vector Lambda so Lambda is equal to and we call it Lambda 1 something in the BX Direction plus something in the by Direction plus something else in the BC Direction so the stuff you've been doing up to now the easy stuff would be Lambda 1 = 0 Lambda 2 = 0 and Lambda 3 = 1 that would be just a simple rotation around bz you know what to do with that you know how to find your rotation Matrix so with just a little bit more math it's not that hard you can say I'd like to rotate not around BX and b y bz but some combination thereof what does my rotation Matrix look like so what happens to this R and the answer is it turns out it's not terribly um you know the math isn't super complicated but it's it's you know a little bunch of signs and cos signs drawing pictures doing some Saka TOA right and it's all in the book but what you end up with is and Sh so b r a we end up with here's a x a y a z and the first element is cosine th that's the angle that you did the rotation lamb 1 2 * 1 - cosine this is how ax Rel to BX when you do the rotation so I the easiest thing to see in doing this is to take a book and say you could rotate around BX or by or bz or you can just rotate along the diagonal okay and I think it's really simple to understand that you say well if I rotate around the diagonal it's not BX or b y bz it's some combination now granted it's only you know this might be non Z this might be non zero and that would be zero so 2 2 220 and what that does is it would take this time I'm going to BU you your job is to hold that corner there all right and our job is to then rotate this okay about the diagonal all right I'm going to rotate on the de so we're going to rotate this we rotate by an angle Theta all right so that would be like 45 de if we rotate by 90 this would be a 90° all right so that's what's meant the so you pick any Vector to rotate about and then you rotate it by a certain angle then you say what happens to the orientation well you can turn it turns out you can put it into any orientation doing this and Theta is the angle that you rotate by and for this case that we just did this Lambda one is 22 this one 22 that one zero so that's BX there's B here's BC I'll just give a few of the elements cu the rest are in the book and the books does I think a pretty good job of of getting it um so this one is Lambda 3 S OFA plus Lambda 1 Lambda 2 * 1 - cosine th and the next one is Lambda 2 sin lamb 3 1 and so on okay so then you get two more elements and the last one I'll just write down on as cosine Lambda 3^ 2 * 1 - cos so you get these elements and you get a very physical thing you just like literally you pick a vector anywhere on the Block and just rotate about it all right so very physical now someone says I'd like you to compute this rotation Matrix I give you Theta and I'm worried about your computational cost I say I want you to compute this rotation Matrix really efficiently all right um and you start C calculating look how many computations does it take well you start off with a Lambda one square now square is actually a pretty straightforward uh it's just multiply okay so this is a multiply cheap a plus is relatively cheap on new machines the plus and multiply all take about the same amount of time and they're very small but then you run to the cosine all right does anybody have any idea how many what the factor like if this is a one and this is a one in terms of cost so plus is about one and multiply is about one does anybody know what a cosine is in terms of cost relative to one take a whack can just take your best guess is it two is it is it a factor two is it factor four all right so give me give me your best number just go around and thr me a number 10 50 50 60 60 two two 10 10 okay we got a good sampling you I'll come back to you guys later so 50 turns out is the number so it's a factor play the lottery today all right so it's very very expensive to do this cosine cosiness are really tedious SS and cosin are have heavy overheads why well if you remember and you do I'm sure this is 1 - th Cub over 3 factorial plus 5 5 factorial plusus 7 7 factorial Plus St that okay so this is calculated through a TA series expansion really expensive Cal calculation and signs and cosin aren't cheap and you actually have a sign I believe you also have a sign in there as well sign yes there's a sign in there as well so you have a sign in here you have a cosine in here it turns out this is expensive so you start looking at and go is there a way for me to not do this calculation now again this there are four variables here the variables the unknowns um that you worry about are uh things you care about say the parameters are Lambda 1 Lambda 2 Lambda 3 and Thea is there a relationship between these yes there's four parameters what is the relationship and now we'll take the other side of the table Andrew what's the relationship Lambda one plus Square L 2 3 is one good and where did that come from uh assuming L un VOR exactly so when we get to the or the parameters it will turn out that's exactly what's going to happen with or the parameters they follow directly from this idea that this zunit Vector you're doing so the constraint is um those are the perimeters and this a constraint that Lambda 1 2 + Lambda 2 2 + Lambda 3 2 = 1 and that's just because of it being a unit Vector okay so you have a constraint so you have four of these and given those four you can calculate these things so given those four numbers liit one two three you do the calculation here is it number now someone says that's lovely I would like to form a different version of this by doing some super clever math and doing a change of variables so we'll do that and the change of variables we'll use all of it involves um basically just trig identities it will turn out that we're using going to use half angle formulas in trig to do a change of variables and guess who did that math that was of course Oiler he said this is this is hard because you know at this point don't forget his children were doing his CS I mean his he had a bunch of kids and he's like go do your calculations and the kids were like hungry and they come home and two hours later they get the coign you know so he said okay this isn't such a good way let me see if I can dream up a faster away for you get dinner so he did and so the way he did it was he said I'm going to introduce and invent this thing where I'm going to say that e0 is defined as just cosine of theta 2 so this is the first thing and all of this is is just to take this stuff and make it into something that's actually easier to compute so the first thing he said I'm I'm very clever I know all the half angle forms again all this is in the book but it's it's not like it's not obvious but once you see it you go wow that's that wasn't so so bad so this is E1 he just said take Lambda 1 and then multiply by S over two and same thing for E2 I just have Lambda 2 * s of theta / 2 and E3 okay so this is the um invention that he did and what does to here is actually just incredibly brilliant it takes the rotation Matrix and I'll just again write out just a few terms and the terms that I write out are here 2 E1 2 plus 2 e0 2 plus sorry minus one that's the first term the next one is 2 * quantity E1 E2 plus E3 e0 and the last one is two E1 E3 minus E2 e0 all right so now we start counting and say and this you know a few more here but they look very similar all right and now you start counting how many how much does this cost so given the parameters so here are your parameters now so someone says great here are your parameters and they e0 E1 E2 E3 what's your cost for calculating the rotation um sure you can see and you realize okay that's that's basically a multiply that's a multiply add and subtract multiplies by two so you're looking at like roughly six this six operations here you come over here forget about the cosiness you still have the two you have to subtract so it's it's a multiply a subtract um another multiply and add so you're already at roughly the same you're not you're not like skipping the cosine you're like this is almost exactly the same computational cost as this if cosine was already precomputed so this turns out to be incredibly more efficient there are no trig functions here at all so there's a major Gap in