Euler showed that three coordinates are necessary to describe a general rotation, and these coordinates are called the Euler angles. To show how Euler angles work, I want you to think about three successive rotations. The first rotation going from frame a to frame b, the second rotation going from b to c, and the third going from c to d. The key idea behind Euler angles is that if I want to describe the rotation a to d, I can break it up into three successive rotations, a to b, b to c, and then c to d. You do this by simply multiplying the intermediate rotations. You take the rotation from b to a, and then c to b, and then d to c, and you end up on the left-hand side with a rotation that goes from d to a. So in this picture, you see that the first rotation about a_1 is through the angle, Psi. It's a rotation about the x axis, and that allows you to get to b_1, b_2, b_3. The second rotation is about the vector b_2, and that gets you to c_1, c_2, and c_3. That second rotation is through the angle, Phi. Then finally, the third rotation which is about the vector c_3, and that's through the angle, Theta. So by simply multiplying rotations about the x-axis through Psi, the y-axis through Phi, and the z-axis through Theta, you end up getting the net rotation which is from frame a to frame d. Again, you want to remember that the nomenclature here refers both to displacements and to transformations. So if I look at a rotation with a superscript a and a subscript d, it serves two purposes. It can transform vectors written in terms of d_1, d_2, d_3 into a vector whose components are written in terms of a_1, a_2, a_3. It can also refer to the fact that a rigid body has been displaced from its initial orientation at frame a into its new orientation at frame d. The three angles that you see here are roll, pitch, and yaw angles. Imagine a vehicle whose axis is oriented along a_1, the first rotation is a roll rotation. The second rotation is a pitching motion about the second axis which is b_2. The third angle is a yaw rotation, and that is about the third axis, which is c_3. Euler said that any rotation can be described by three successive rotations about linearly independent axes. So if you have three Euler angles, like the angles I just described to you, you can deduce from them a three-by-three rotation matrix. The question you want to ask yourself is if the reverse is true? In other words, for every rotation matrix, is there a unique set of Euler angles? In other words, does this map between the three coordinates, the three Euler angles, and the rotation matrix, is this map one-to-one? The answer is no. It's almost one-to-one, but there are certain points that are analogous to the North Pole and the South Pole on the Earth's surface, at which the Euler angles are not well defined. This set of Euler angles is often called the X-Y-Z Euler angles. That's because the sequence in which these rotation matrices are multiplied, relates to a rotation about the x-axis, followed by the y-axis, followed by the z-axis. You can also have other types of Euler angles. This particular one is called a Z-Y-Z Euler angles. So again, the first rotation is about the z-axis. You rotate about the z-axis through Phi, and then the second rotation is about the y-axis through Theta. Then the third rotation is a rotation about the z-axis through Psi. Notice that every rotation occurs about a body fixed axis. Once you complete the first rotation, the second rotation about the y-axis is now about a new y-axis because the first rotation rotated the original y-axis into a new position. Although you have two rotations about z-axis, the question you have to ask is are they the same z-axis or different? In other words, are the three axes linearly independent? You can see that the two z-axes are not co-linear, they are independent. If this condition is satisfied, then the three angles are Euler angles, and they can parameterize the set of rotations. Note that if you have an Euler angle that is zero, in this case Theta being equal to zero, you might run into problems. So Theta equal to 0 would cause the two z-axes to be co-linear. As a result, you will not have the condition of linear independence. In other words, the three axes about which you're performing rotations are no longer independent. So Theta equal to 0 is analogous to being at the North Pole or the South Pole on the Earth's surface. To explore this further, let's look inside the computations that are involved in going from a rotation matrix to the three Euler angles. I'm assuming I have a known rotation matrix, a set of nine numbers. I want to recover the three Euler angles Phi, Theta, and Psi. In order to do this, I can write out the result of the multiplication of the three rotation matrices. The rotation about the z-axis, followed by the rotation about the y-axis, followed by the rotation about the z-axis The first one through Phi, the second one through Theta, and the third one through Psi. Then I can equate these two, you will see that by equating the three-three element in the bottom right hand corner. If I know R_33, I can calculate what Theta is, so that equation tells me what Theta is. Likewise, if I know what Theta is, I can look at three-one element, and calculate what Psi is. In fact, there's a second equation that also gives me the same information. The three-two element also tells me what Psi is, if I know what Theta is. Then finally, the one-three element and the two-three elements tells me what Phi is. Knowing what Theta is, I can calculate Phi from these equations. If the three-three element is non-zero, then we can go ahead and calculate Theta. You calculate it by taking the inverse cosine function. Of course, the inverse cosine function has some ambiguity and because of that, you don't know the sign of Theta. It could either be positive or negative, but modulo that ambiguity, you can determine Theta. Once you know Theta, you can calculate Psi and Phi using the inverse tangent function. You will notice that we had two pieces of information for both Psi and for Phi, and because of that we don't use the standard inverse tangent function. We use something called the atan2 function. The atan2 function helps us overcome the ambiguity that exists in inverse tangent functions. Unlike the traditional inverse tangent function which only uses one equation to solve for an angle, here we use the fact that we have two equations for the same angle. The inverse tangent function, atan2, allows us to do this. You will see from these equations that we have two sets of Euler angles, and this is true for almost all rotation matrices. These equations were derived assuming that the magnitude of R_33 is not equal to one, it's less than one. So what happens if the magnitude of R_33 is equal to one? It can either be plus one, or minus one. In those cases, you can easily see that the angle Theta is going to be equal to either zero or Pi, and you have two alternatives. In both these cases, you will see from the grouping of terms that the rotation matrices are functions only of the sum of two angles; Phi and Psi. In other words, it's impossible to determine either Phi or Psi uniquely. Given one you can determine the other, but it's impossible to disambiguate between Phi and Psi because the groupings only contain terms that combine them. So when R_33 is equal to either plus one or minus one, you have infinite set of Euler angles. In most of our work, we use a different set of Euler angles. These are the Z-X-Y Euler angles, and again, they're so-called because the three rotation matrices we consider are the rotation about the z-axis through Psi, followed by the rotation about the x-axis through Phi, and then the rotation of the y-axis through Theta. You should be able to verify by multiplying the rotations, you get a rotation matrix that has the form shown in this slide. We've seen for every set of Euler angles, you might have at least two solutions for Euler angles, for a given rotation matrix. At some points, you can have infinite solutions. What you really want is a second set of Euler angles to take care of the points at which you have infinite solutions. So this suggests that you might have many sets of Euler angles that you might want to consider, so that you don't have a point at which you have infinite solutions. So the question that's worth asking is what is the minimum number of sets of Euler angles you need to cover all of the rotation group?