Rotating around an arbitrary axis
A vector lying on the x axis that is represented by (1, 0) and rotated by results in the vector that will be the cosine of the angle and the sine of the angle ( as illustrated in Figure 16.1. Likewise, a vector sitting on the y axis represented by (0, 1), when rotated by the same angle, will result in a vector that, too, contains a combination of cosine and sine as (-.
Figure 16.1: Two-dimensional rotations
Do these values look familiar? They should because they are the values we’ve used in the rotation matrix for a rotation around the z axis in Chapter 15, Navigating the View Space. Rotating in 2D is essentially the same operation as rotating around the z axis; as you can imagine, the z axis added to Figure 16.1 coming out of the screen toward you, and thus rotations in this 2D space are, in fact, rotating around an unseen z axis.
All the rotations we’ve looked at thus far have been to rotate a vector or...