Rotation about an arbitrary axis(Part 2)

Realizations in 3D Consider the following:

If the rotation axis passes through (0,0,0) and a point (a,b,c):

1) What is the length of the vector along the rotation axis starting at the origin (0,0,0) to (a,b,c)?

Visually, we are looking at the following:

2) What are the direction cosines of the rotation axis?

3) Suppose one point on the rotatin axis is (x,y,z) and another is (x',y',z'), then a vector along the axis is:

vec(v) = [(x'-x) (y'-y) (z'-z)]

If the vector is normalized, then it is the vector of direction cosines:

[a b c] = vec(v)/sqrt((x'-x)^2+(y'-y)^2+(z'-z)^2)

That is, a = cos(alpha), b = cos(beta), c = cos(gamma)

Remember, that [a b c] form a unit vector along the axis of rotation.

Problem: Suppose one point on the axis of rotation is (3,5,4) and the axis passes through the origin.

1) Draw this setup using the orientation of the above 3D coordinate system.
2) What are the direction cosines of the rotation axis? [a b c] = ?
3) Show that [a b c] is a unit vector.

Rotation about an arbitrary axis:

Define (x,y,z) as a point through which the rotation axis passes and [a b c] as the direction cosines of the axis. i.e. a unit vector along the rotation axis.

Problem: Define the steps in the rotation through the angle theta (we can choose cw or ccw) about the axis.

Step#1: Translate the object into a new coordinate system where (x,y,z) maps to the origin (0,0,0).


T = 1   0   0   0
    0   1   0   0
    0   0   0   0
    -Tx -Ty -Tz 1

After the translation T, the rotation axis passes through the origin. We must now align the unit vector [a b c] with the axis we would like to use for the rotation. In this case we will choose the z-axis.

Step#2: Rotate about the x-axis into the xz-plane.

We remember that rotation from y+ -> z+ is of the form:

1   0    0   0
0   cos  sin 0
0   -sin cos 0
0   0    0   1

So what is the matrix that will rotate the unit vector into the xz-plane?

That is,

Rx = ?

Step#3: Rotate the resultant vector into the yz-plane.

Step#2 produced the following:

Now for the all important four questions:

1) why is the y-coordinate 0?

2) Why is the vector now [a 0 v]?

3) Is [a 0 v] is still a unit vector?

4) What is the resultant matrix that will rotate [a 0 v] into the yz-plane.

Ry = ?

Step#4: Rotate about z by theta degrees in either a cw or ccw direction as desired.

Step#5: Reverse Step#3 by multiplying by the inverse of Ry, which is?

inv(Ry) = ?

Step#6: Reverse Step#2 in a similar fashion.

inv(Rx) = ?

Step#7: Reverse Step#1 in a similar fashion.

inv(T) = ?

Therefore, the rotation about an arbitrary axis is:

[x' y' z' 1] = [x y z 1] T Rx Ry Rz inv(Ry) Inv(Rx) inv(T).


©1995 Douglas J. Ryan
Douglas J. Ryan/ryand@tardis.pacificu.edu