Another important transformation is rotation of a point about an axis. In 3-D space a point can be rotated about the x axis, y axis or z axis. This means we have three degrees of freedom (called dof). There is one point that I should make right now. The order of rotations is important. If you rotate a point on the x axis and then rotate it on the y axis, this is not equivalent to rotating it on the y axis and then on the x axis. (except in freak circumstances). All of our transformations have the same restriction when mixed together. If you were to translate a point and then rotate it on the x axis, this would not be the same as rotating it on the x axis and then translating it. the order is important! it is really common sense. If you were to walk forward 5 feet and turn left 90 degrees, you would not be in the same position as you would if you turn 90 degrees and then walk forward 5 feet.
The square matrices that rotate a point in 3-D space over an axis have been derived from simple trigonometry. Since they have already done the work, all we have to do is use these rotation matrices. In the diagrams below are the three rotation matrices for rotating a point over the three axes x, y and z. the angles (X), (Y) and (Z) are the angles the point will rotate through over the x, y, and z axes respectively. To get the new position of the point, you need to apply these matrices in the order that the actual rotations will occur. So, if you are going to rotate over the y axis and then the x axis, you will apply the y axis rotation matrix and then the x axis rotation matrix to the column matrix of the point.
One question which arises at once is this. How do you know which way is a positive rotation on a given axis and which way is negative? Use the right hand rule. Grab the axis with your right hand, thumb pointing in the positive direction of the axis and your index finger extended. Your index finger tells you which way is positive around that axis. Conventionally, counter clockwise (CCW) is positive if you are looking down the axis from a positive direction.


