Cynthia Vaskis

SLM521 Spring 2004

Dropin #2 Assignment

4/2/04

File: matrotR1.htm

 

Lesson Title:  Math Calculations to Rotate an Object in 3D Space – Rotation matrix about the X axis

 

Let’s define an object in 3D space as an example.  Pick at least three separate points in 3D space on graph paper and label the points with their (x, y, z) values.  For the examples here, use these three points which represent a triangle in 3D space.  See diagram of this triangle in 3D space.

 

Point 1 = (x1, y1, z1) = (1, 1, 1)

Point 2 = (x2, y2, z2) = (2, 2, 2)

Point 3 = (x3, y3, z3) = (1, 1, 2)

 

To rotate an object around its X, Y and Z axes, use the three rotation matrix equations in (5), (6), and (7) (click and move down to see the rotating boxes about each axis and matrix equations (5), (6), and (7)).  The first box rotates about the X axis, the second box rotates about the Y axis, and the third box rotates about the Z axis.  The rotation matrices, listed in matrix equations (5), (6), and (7), are listed again below.

To rotate an object about one axis the set of equations is written in the form called a rotational matrix.  It is really a list of simultaneous equations with their coefficients taken out and placed in a box structure.

 

For rotations about the X axis, use the matrix equation (5) in the reference made above.  To rotate an object about its X axis the amount of angle alpha, notice that the one (1) in the first row and first column indicates that the rotation does not change the X values in the object’s definition.  The positive rotation direction is clockwise as you look down the coordinate axis vector that you are going to rotate around toward the origin of the coordinate system.

         

To rotate an object about just one of its axes at a time is done by multiplying the associated rotational matrix with each of the object’s definition vectors to obtain new definition vectors that are in the rotated position.

The rotational matrices use the trigonometry functions of sine and cosine of the rotational angle.  To understand how we calculate values for the sine and cosine we must look at the unit circle with the sine and cosine values for several angles around the circle.  Of course, you could use any angle amount between -180 degrees and + 180 degrees but the value would have to be looked up in a trigonometry table.  For simplicity, the examples use angles that produce well know whole number (integer) sine and cosine values such as -1, 0 and +1.

 

 

To multiply a matrix times a vector you first write the matrix down and then write the vector in a vertical position to the right of the matrix.

 

For our example we will use the angle alpha = +/-180 degrees, Thus, the cosine of (+/-180)) = -1 and the sine (+/-180 degrees) = 0.

The rotational matrix for a rotation about the X axis of +/-180 degrees is below.  The object’s points are Point 1 = (x1, y1, z1) = (1, 1, 1),

Point 2 = (x2, y2, z2) = (2, 2, 2), and Point 3 = (x3, y3, z3) = (1, 1, 2) and they are rotated one at a time.

 

Look here for basic matrix multiplication operations.

 

The first matrix multiplication follows (rotating Point 1 about the X axis):

 

____________________________________________________

 

The second matrix multiplication is rotating Point 2 about the X axis:

__________________________________________________

 

The third matrix multiplication is rotating Point 3 about the X axis:

 

Remember these resulting new vectors Point 1 = (1, -1, -1), Point 2 = (2, -2, -2), and Point 3 = (1, -1, -2) since they will be used as the starting Point vectors for the Y axis rotations (Pitch maneuvers) next.