In this robotics and aerospace tutorial, we explain the concept of rotation matrices. The rotation matrices are very important in robotics and aerospace engineering. In this tutorial, we derive the expression for the Z-axis rotation matrix.
We noticed that it is a common misconception among students studying robotics and aerospace that rotation matrices are actually rotating vectors. They are not rotating vectors, they are the consequence of two coordinate systems rotated with respect to each other. Usually, the so-called body coordinate system is fixed to the rotating object, and rotation matrices are used to transform the coordinates of a vector from the body frame to some other (usually inertial) frame. There is another mathematical interpretation in which the rotation matrices are rotating vectors in the same coordinate system, however, this interpretation is not used in robotics and aerospace.
Here is the tutorial we made that explains
- What are the rotation matrices.
- How to derive the rotation matrices
- How the rotation matrices are used to transform coordinates from one coordinate system to another.
The YouTube tutorial accompanying this tutorial is given below.
We consider the situation shown in the figure below.
We have two coordinate systems A and B, with the coordinates
Next, let us consider a vector
Problem: Knowing the coordinates of the vector
To solve this problem, let us introduce the following notation. The notation
(1)
denotes the vector
(2)
denotes the vector
It should be kept in mind that the vectors
(3)
The vector
(4)
Here one thing should always be kept in mind. The unit vectors of both coordinate systems
(5)
That is, we have
(6)
By substituting (3) and (4) in (6), we have
(7)
By scalarly multiplying the equation (7) with
(8)
By scalarly multiplying the equation (7) with
(9)
By scalarly multiplying the equation (7) with
(10)
Let us write the equations (8), (9), and (10) together
(11)
The last three equations can be written in the matrix form as follows
(12)
The last equation can be written compactly
(13)
where
(14)
The matrix
Since the vectors
(15)
By substituting (15) in (14), we have
(16)
The matrix defined in (16) is the rotation matrix defining the rotation of two coordinate systems around the
To summarize, the expression
(17)
implements a mapping. It transforms the projections of the vector
Another important property of the rotation matrices is that they are orthogonal, that is,
(18)
This is important since from (17), we can write
(19)
More about the properties of the rotation matrices can be found here.