Rotation matrices are orthonormal. This means that the columns are all perpendicular to one another (their dot products are all zero), and each of the three columns’ length equal 1.

Inverse of a rotation matrix

Because of their orthonormal-ness, it means the inverse of a rotation matrix is just its transpose. Remember that this is not true for all matrices.

Rotation about an axis

Copy over derivation steps from handwritten notes

Note how the negative sign appears in the top-right corner for the x-axis and z-axis, while it appears in the bottom-left for the y-axis.

General rotation matrices

Combining rotation matrices into one

Rotation matrices can be “combined” by multiplying them. The end product is also a rotation matrix and maintains its properties, i.e. orthonormal. Using this we can represent a sequence of rotations as a single matrix. For example, if we wanted to

  1. Rotate about x-axis
  2. Rotate about z-axis
  3. Rotate about x-axis, again

We can represent this sequence of rotations as a simple matrix: . Multiply them together to get .

Remember that since Euler angles inherently represent rotations about local axes, we always post-multiply subsequent rotation matrices. This is convenient because the order, e.g. , directly corresponds to the order in which we multiply their matrices: .

Euler angles to rotation matrix

Usually what interests us is a rotation matrix comprised of exactly one , , and each, because these directly correlate to Euler angles and quaternions. However, the order in which we multiply them matters and affects the end result. Therefore there exists different general rotation matrices for different rotation orders.

I’m adding them here as I encounter more/am forced to calculate them.

XYZ

Interpretation of the columns

Given a rotation matrix , we can divide it into its three columns.

It turns out that these three columns are the three basis vectors of the new coordinate system after has been applied. That is, if we’re transforming from frame to frame using , then

where , , and are the basis vectors (x-, y-, and z-axis) of frame . This shouldn’t be surprising knowing that rotation matrices are orthonormal.