The Rotations

If the z-axes points from the screen, and if you rotate the base vectors by an angle \(\alpha\) around the z-axes, you get the rotated vectors as in the picture below.

Image

The third base vector, that is parallel to the z-axes, does not change.

The rotation matrix \(\mathbf{T_z}\) for rotation around the z-axes is:

\[\mathbf{T_z}=\left( \begin{array}{ccc} \cos \alpha & -\sin \alpha & 0 \\ \sin \alpha & \cos \alpha & 0 \\ 0 & 0 & 1 \end{array} \right) \]

In a similar way you can find the rotation matrices for rotation around the x- and the y-axes.

\[\mathbf{T_x}=\left( \begin{array}{ccc} 1 & 0 & 0 \\ 0 & \cos \alpha & -\sin \alpha \\ 0 & \sin \alpha & \cos \alpha \end{array} \right) \]

\[\mathbf{T_y}=\left( \begin{array}{ccc} \cos \alpha & 0 & \sin \alpha \\ 0 & 1 & 0 \\ -\sin \alpha & 0 & \cos \alpha \end{array} \right) \]


Exercise

This is a continuation from the previous page.

  • Enter three sliders representing the three rotation angles, one angle per axes/base vector.
  • Enter three rotation matrices, one matrix for each angle.
  • Instead of just projecting the matrix \(\mathbf{v}\) to 2D, it must now be rotated before the projection. Change the definition of the matrix \(\mathbf{w}\) from \(\mathbf{w}=\mathbf{Pv}\) to \(\mathbf{w}=\mathbf{PT_xT_yT_zv}\)

This continues with the cube on the next page.

by Malin Christersson under a Creative Commons Attribution-Noncommercial-Share Alike 2.5 Sweden License