[MUSIC] In this module, we will dive into the fundamental concepts required to describe three dimensional motion. Both position and orientation of rigid objects flying through the space. We will want to develop the basic tools to describe three dimensional displacements through rigid body transformations. The key concept we want to talk about now is the concept of a reference frame. We associate with each position and orientation a reference frame. Let's call these positions and orientations A and B. In reference frame A, we find three linearly independent basis vectors a1, a2, and a3. In this picture, they're shown to be mutually orthogonal. While they don't have to be, it's convenient to choose them to be mutually orthogonal. The key idea here is that they must at least be linearly independent. Likewise, in frame B we have three vectors, b1, b2, b3. a1, a2, a3 is attached to frame A. b1, b2, b3 to frame B. Now any vector in three dimensional space can be written as a linear combination of these independent vectors. So in frame A, we would write it as a linear combination of a1, a2, a3. In Frame B, we would write it in terms of b1, b2, and b3. Now for some notation. Typically we use boldface to denote vectors, and we may use a leading superscript to denote the frame in which we are writing that vector in. In some cases, you may also see lower cased italicized letters to denote vectors. Similarly for reference frames, we use italicized letters but these are usually upper case. However depending which texts or papers you look at, you might also see lowercase letters italicized to denote reference frames. So there's a lot of potential for confusion. And oftentimes you must go back and recalibrate yourself with new notation every time you read something new. Matrices are denoted by uppercase, boldface letters. And then we talk about transformations. So these are the main concepts that we use to think about how vectors in one frame can be written in another frame. So for instance, if you see an uppercase letter A with a leading superscript A and a trailing superscript B, that usually denotes that you have an object that transforms vectors in B into vectors in A. The same with uppercase R, leading superscript A, trailing superscript B. You may also have Greek letters. You might also see the lower case letter g, italicized with two trailing subscripts, a and b. This again denotes a transformation from frame B into frame A. Let's talk about rigid body displacements. Here's an object, O, a collection of points in three dimension. It is a subset of R3. The object can have multiple positions and orientations. A rigid body displacement is nothing but a map from this collection of points in the object, to its physical manifestation in R3. As time changes, this object may occupy different positions and orientations. Accordingly, you have different rigid body displacements. Again, each one is a map of this collection of points in O to their physical manifestations in the real space, which is R3. What is rigid body motion? Well, as time changes, now you have a continuous family of maps, so g, which is a displacement, is now parametrized by time. As time changes, you have the collection of points in O, moving from one position in orientation to another position in orientation, and so on. And this is a continuous set of displacements. So this is what we see in a quadrotor, starting off from a horizontal position, moving to another position, accelerating, changing its orientation, changing the direction of the thrust and then reversing the direction of the thrust by pitching back, and then slowing down to the goal position. Each one of these snapshots is a displacement. And actually this sequence of displacements represents a continuous family of displacements. Now let's look at a single point on the rigid body, p. When this rigid body is displaced, the point p gets displaced into a new point, which we will call g(p). A displacement is essentially a transformation of points. And of course, there are infinite points in a rigid body. If you have a second point, q, the same displacement will take q and move it into a new point, g(q). Every pair of points defines a vector. The vector v emanates from p and terminates at q. Since g moves p to g(p), and q to g(q), it also moves the vector v to a new vector, and we call this vector g*(v). So displacement g induces a map on vectors. Remember, the displacement acts on points, but g* acts on vectors. What makes the map, g, a rigid body displacement? Well there are two properties that the map must satisfy. First, the distance between any pair of points remains unchanged in a rigid body displacement. In fact, that is the definition of the word rigid. So if I calculate the distance between p and q and the distance between g(p) and g(q) after the displacement, those two distances must be identical. So lengths must be preserved. The second property that rigid body displacements must satisfy has to do with cross products of vectors that are attached to the rigid body. Here we have a single vector emanating from p and terminating in q. Now let's choose a third point, r, and generate a second vector going from p to r. We can ask what happens to this vector w when the body gets displaced to its new position and orientation. Well, g* acts on w to generate a new vector, g*(w). Now we can look at the cross product of v and w and ask what happens to that cross product while it goes to v cross w. If you look at the mapping of v into g*(v) and the mapping of w into g*(w), you can compute the cross product of g*(v) and g*(w). It turns out that the cross product remains the same whether you do it before the displacement or after the displacement, if the displacement is rigid. Cross products are preserved. So if you look at the family of maps which preserve distances and cross products, you essentially get rigid body displacements. So these are the two properties, and you should be able to prove that for a rigid body displacement, orthogonal vectors are mapped to orthogonal vectors, and further, g* preserves inner products. That is, if you compute the inner product of two vectors before the displacement, and in a product of the same two vectors after the displacement, those inner products are the same. If you take a set of mutually orthogonal unit vectors attached to the rigid body, after the displacement, those vectors will remain mutually orthogonal, and they will remain unit vectors. In summary, rigid body transformations, or rigid body displacements, satisfy two important properties. They preserve lengths and they preserve cross products. Rigid body displacements and rigid body transformations are frequently used interchangeably. There is one important semantic difference. Transformations generally referred to relationships between reference frames attached to two different rigid bodies, while displacements describe relationships between positions and orientations of a frame attached to the rigid body as it moves around. Now that I've given you an abstract description of what a rigid body displacement is, let's explore how we can actually do calculations to describe rigid body displacements, and then manipulate these displacements. We're starting with the assumption that we have mutually orthogonal unit vectors attached to every rigid body. If it's a transformation, we're referring to two different rigid bodies. If it's a displacement, it is two distinct positions and orientations of the same rigid body. We can write the mutually orthogonal unit vectors in one frame as a linear combination of the mutually orthogonal unit vectors in the other frame. So here I've chosen to write b1, b2, b3 as linear combinations of a1, a2, a3. And the coefficients are given by R11, R12, and so on. This collection of nine coefficients can be gathered into and matrix, and we call this matrix a rotation matrix. This rotation matrix has several interesting properties. It turns out that this matrix is orthogonal, which means if you take this matrix and multiply it by its transpose, you get the identity matrix. If you take the transpose of the matrix and multiply it by the matrix, you also get the identity. The matrix is special orthogonal, in other words, if you compute its determinant, the determinant is plus one. Third, the product of any two rotation matrices gives you a rotation matrix. And forth, the inverse of a rotation matrix is also a rotation matrix. These properties will come in useful as we go ahead. Now let's start looking at the structure of a rotation matrix. Again, I have a rigid body, and I show two distinct positions in orientations of the same rigid body. I also have a point, q, that I'm going to follow as it moves from one position to another position. So the position vector PQ, where P is the origin, can be written in two different ways, depending on which snapshot I consider. In the first case, I write it as a linear combination of a1, a2, and a3, and in the second case, I'm writing it as a linear combination of b1, b2, and b3. So now let's focus on this vector, PQ. I have two distinct position vectors, they're both PQ. I'm going to translate the rigid body so that the the two vectors have the same origin. So one vector is PQ. The second vector is now PQ prime. Again I can write it as a linear combination of a1, a2, and a3. But now I'm going to get two different sets of coefficients. Where there, if I look at PQ, it has coefficients q1, q2 and q3. If I look at PQ prime, it has coefficients q1 prime, q2 prime, and q3 prime. I can ask how to write q1 prime, q2 prime, and q3 prime as a function of q1, q2, q3. Is that a matrix that connects them? And I can also ask the reverse question. Is there a matrix that connects q1, q2, q3 to q1 prime, q2 prime, and q3 prime? It turns out that this matrix is exactly the same matrix that we looked at earlier, the rotation matrix. If I know how to write the mutually orthogonal unit vectors in one frame as a function of the other set of vectors, and I can do this by calculating the rotation matrix, the same matrix tells me how to transform vectors in one frame to another frame. As an example, I want to first look at something very simple. Consider this rigid body, a rectangular prism, whose axes are aligned with the x, y, and z axis, or the a1, a2, and a3 unit vectors. Let's rotate this rigid body about the x axis, through an angle, theta. So when you have this rotation, there's only one parameter that describes this rotation, and that's the angle theta. You can write this rotation matrix and you will find that it has nine numbers. Four of the numbers are zero. There's an identity at the top, and the other numbers are essentially cosines and sines of the angle of rotation. You can verify this through geometry. The calculations are actually quite simple. Here are examples of two other rotation matrices. The one of the left refers to a rotation about the y axis, again through an angle, theta. The one on the right refers to a rotation about the z axis, also through an angle, theta. Again, in both these cases, there are four zeros, a one, and everything else you see in the rotation matrix is either the cosine or a sine of a rotation angle, which is theta. In general, rotation matrices can look more complicated, but when you have rotations about the x, y, or z axes, they assume these very simple forms.