12. Rotations

12. Rotations

We'll analyse some examples of 3-by-3 rotation matrices, and then see to figure out the axis and angle of rotation for a general 3-by-3 rotation matrix.

Example 1

Let A = ( cos θ - sin θ 0 sin θ cos θ 0 0 0 1 ) . This is an example of a 3-by-3 rotation matrix. The top-left 2-by-2 block rotates the x y -plane, and the 1 in the bottom-right tells us that the z -axis is fixed. More precisely: ( cos θ - sin θ 0 sin θ cos θ 0 0 0 1 ) ( x y z ) = ( x cos θ - y sin θ x sin θ + y cos θ z ) , so the vectors ( x y 0 ) in the x y -plane get rotated by the 2-by-2 rotation matrix ( cos θ - sin θ sin θ cos θ ) , and the vector ( 0 0 1 ) which points along the z -axis is fixed.

Rotation by theta around z-axis

A key point here is that the axis of rotation is fixed, i.e. any vector u pointing in the z -direction satisfies u = A u .

Example 2

Let B = ( 0 0 1 0 1 0 - 1 0 0 ) . This is another example of a 3-by-3 rotation matrix. What is the axis of rotation? We need to find a vector u = ( x y z ) such that u = B u . In other words, ( x y z ) = ( 0 0 1 0 1 0 - 1 0 0 ) ( x y z ) = ( z y - x ) . This is three equations (one for each component): x = z , y = y , - x = z . The equation y = y is trivially satisfied. The other two equations imply x = z = 0 . Therefore u = ( 0 y 0 ) , and u must point along the y -axis.

By comparing with Example 1, the angle of rotation can be found by:

  • taking a vector v which lives in the plane orthogonal to the axis,

  • applying B to get B v ,

  • computing the angle between v and B v using dot products.

For example, we could take v = ( 1 0 0 ) (as v u = 0 so v is orthogonal to the axis). Then B v = ( 0 0 - 1 ) , so v B v = 0 . If θ is the angle between v and B v then this implies cos θ = 0 , so θ = ± 90 degrees.

In fact, we can understand exactly what this rotation is doing by drawing the images of the basis vectors e 1 , e 2 , e 3 under B (i.e. the three columns of B ). The vector e 2 is fixed, e 3 goes to e 1 and e 1 goes to - e 3 , so this rotates by 90 degrees about the y -axis, sending the positive z -axis to the positive x -axis.

Rotation by x-axis by 180 degrees

Example 3

Take C = ( 0 0 1 1 0 0 0 1 0 ) . This is another 3-by-3 rotation matrix; we'll find the axis and angle of rotation.

Remark:

These examples are carefully chosen to be rotation matrices. Note that if I gave you a random 3-by-3 matrix, it probably wouldn't be a rotation matrix, and isn't guaranteed to have any fixed vectors at all.

To find the axis u = ( x y z ) , we need to solve u = C u : ( x y z ) = ( 0 0 1 1 0 0 0 1 0 ) ( x y z ) = ( z x y ) . The first two equations imply x = y = z , so the third is redundant, and any vector of the form u = ( x x x ) is fixed. In other words, the axis points in the ( 1 1 1 ) -direction.

To find the angle, pick a vector v orthogonal to u . For example, v = ( 1 - 1 0 ) satisfies u v = 0 so is orthogonal to u . We compute v C v = ( 1 - 1 0 ) ( 0 1 - 1 ) = - 1 . We also know that if θ is the angle between v and C v then - 1 = v C v = | v | | C v | cos θ . Since | v | = | C v | = 2 , we get cos θ = - 1 / 2 . This tells us that θ is 2 π / 3 (or any of the other values that have cos θ = - 1 / 2 ). Let's draw a picture to convince ourselves it's really 2 π / 3 (120 degrees).

The axis of rotation points out of the screen:

Rotation by 120 degrees around (1,1,1)