Good, so let's just make up a sequence. Trevor, give me a number, just 1, 2, or 3. >> Just the first number. >> 1, okay, Kayley. >> 3. >> 3, good. Nick, [LAUGH] I get a star on your name, okay, Nick. >> 2. >> 2, okay, let's say we want to do this, a 1-3-2 sequence, and I want to relate these angles to the equivalent DCM. Mendar, how do we do that? So here, you have theta 1, theta 2, theta 3. First, second, third angle, we can do in a 1-3-2 sequence. How do you construct the equivalent direction cosine matrix? >> Take the cosines and sines. >> That's not going to go very far. How do I come up with the right cosine and sines? >> You split it for each axis. >> Mm-hm, it's a sequence of rotations. >> Yeah. >> Okay. >> So for the first and then just multiply each matrix. >> Okay, so where do you start? I've got three matrices. Which one do you want to fill out, Mendar? >> Number 2. >> You want to do 2, okay, [LAUGH] that's the easy one, you're smart. >> [LAUGH] >> So we're doing a rotation about which axis? You picked the easy one, you should know the answer, which one? >> Which? >> Which axis, 1, 3, or 2? >> Okay, 3. >> 3, and which angle goes in here? Theta 2, come on, guys. So what else goes on? Nathaniel, which one goes here? >> M1 of theta 3. >> Almost, What's wrong with this? Either the 1 or the 3. Tebone? >> It's theta 1. >> Theta 1, right? Remember, because when we're doing these things, we always go from n to b, right? This is where the two letter notation might help you. So the right hand side, we need to start out from the end frame, and the first rotation we're doing is for the Trevor was a one rotation. So start on the righthand side with a 1, but that has to be then also the first angle, not the third. So I'm glad you said it, because hopefully now, you'll never get this wrong again. And hopefully everybody will get this right in the exam or their homeworks, right? That you can derive this, we're doing a 1, 3 and then this one is 2, but you're doing your first, second, third from the right hand side, use this. There are some problems in the homeworks where, yes, you can do maybe these projections and angles in your head, or you can draw figures and figure out how these things all project on to each other. But who has time for that? Really, this is way, way easier. You look at the sequence, I have to do this, I have to do this, and I get there and I'm good. I trust the math. I don't trust my way to quite interpret anything more than two frames, especially in 3D, even two frames, I'm going to do the sequence. So you will find in our homeworks, even though I'm not saying use Euler angle sequences to define this stuff, you will find an Euler angle sequence is very, very handy to do that. Okay, if we have the BN matrix, the last thing we had was, okay, now I know how to go from Euler angles to the DCM. And in fact, in the book, in the appendix, there's actually a whole list of all twelve sets. So you can do this, you can go look it up and see if you did your homework right. How did we go backwards from this stuff? All right, so you have a DCM. Robert, what do you remember, if we have a, let's just draw it out generally, a DCM would have nine numbers, right? And if you do this, what pattern are you looking for to extract Euler angles? >> I just look at terms that can be turned into a trigonometric identity that I know well. >> But there's a dead simple one, there's two so-so ones, and then there's four, nah, not so nice ones, right? Which angle will always appear in a dead simple way? The second one again, so our second is the troublemaker. It kind of overcompensates and becomes the easiest one to extract, always, all right? So if it's a asymmetric sequence, yaw, pitch, roll, are you looking for a sine or a cosine of that angle? Yeah, a sine in this case. because pitch is defined plus minus 90 degrees, right? That kind of leaves the quadrants. The first and third Euler angles is always defined across all four quadrants. But it's the second one that's kind of limited. If it's a symmetric sequence, 3-1-3, your inclinations are defined between what angles? What's your range of inclinations, Kaylee? >> For singularity or- >> No, just what possible range of inclination angles could you have from this value to this value? >> 0 to 180? >> 0 to 180, right? And that is an inverse cosine. So, again, right away, knowing this a symmetric sequence asymmetric, you should see, did I do some error in my math? So somewhere in here, and it could be anywhere, I just say, could be this one, might be a minus sine of theta 2 or a cosine of theta 2, depending on if it's symmetric or asymmetric. The minus, you just don't know. The math tells you what it is. Okay, that's how we get the middle one. How do we get to the other two then? Who remembers the pattern? Was it Kayar? >> Yeah. >> What do we do with the other two? >> Well, we sine theta plus theta something, we just need to divide those things and get the tan of the function? >> Exactly, so there's the other two. Let's say this one here is sine theta 2, cosine theta 1. You don't want to just say, hey, I know it's theta 2, I can plug that in and find the cosine and then take inverse cosine. because it will only give you two quadrants, you will never get the right quadrant. So for the first and the third, because of the definition, they're good for all four quadrants. We have to look for tangent functions, and we get that by taking one of that product divided by the other product. That pattern always appears. We end up with a sine theta 1 over our cosine theta 1, and that's the tangent and the same thing for the third one, okay? Good, that was a quick review over these things that you should remember. So we're going to go through an example next. So here, we went through this. This was the sequence that we have. This is the way you extract it, and be very careful, because for the 3-1-3 sequence, you can find, for example, we have to divide by 3, 2. Here, I get the sine theta 1. I need plus cosine theta 1. So I have to multiply it times a -1 on this element and keep that -1 in the numerator or denominator, makes a difference, otherwise, you mess with the quadrants. Kayo? >> What exactly do we mean when we say 1-3-2 Euler angles? What does it mean, the 3 and 2? >> Well it's your axis sequence, you have your base frame, going from inertial to a body. And I have 1, 2, and 3. You have to label what's your first axis, second, and third. We typically call them M1, 2, 3, but sometimes, you have EL, and EZ, and specify what's first, second, third, all right? But now if you're doing a 1, that means you do your 1 rotation first, then you do a 3 rotation, and then the 2 rotation is last. >> 1-3-2 can also be 2-3-1 based on how we define our axis, right? >> Yes, in fact, an animation I showed you a lecture or two ago, where we did the sequences, but end up with the same coordinate frame, if you have 1-3-2 and you want to convert it into a 3-1-3 set. You take those angles, you map them to the DCM, and then from the DCM, you use the correct formulas to bring back the desired angle sequence sets. So we can always translate from one set of angles to another set of angles to have an equivalent attitude, all right? Yes, it's called attitude corner transformation. You can translate from Cartesian coordinates to cylindrical coordinates to spherical coordinates. Here, everything goes tuned from the DCM for sure, sometimes there's easier, faster ways, direct ways. Good, okay.