Cynthia Vaskis

SLM521 Spring 2004

Dropin #2 Assignment

4/2/04

File: matrixop.htm

 

Lesson Title:  Math Calculations to Rotate an Object in 3D Space – Matrix Operations

 

When multiplying a matrix times a vector use the following format.

 

The matrix has rows and columns.  Each element (or coefficient value) in the matrix A is called a(i,j) and has two indices each, a row number “i” and a column number “j”.  For example, the element defined as a(1,1) means the first row and first column element of matrix A.

 

 

 

Example: The element b(2,3) means the second row and third column element of matrix B as below.

 

 

 

To multiply a vector P = (x, y, z) by a matrix A perform the following multiplications and additions:

 

 

where P’ = (x’, y’, z’) is the new vector.  The multiplication of matrix A times vector P results in vector P’.

 

Originally, the matrix A was formed from three simultaneous equations

 

a(1,1)*x +a(1,2)*y + a(1,3)*z = x’

 

a(2,1)*x + a(2,2)*y + a(2,3)*z = y’

 

a(3,1)*x + a(3,2)*y + a(3,3)*z = z’

 

and the coefficients (or a(i,j) numbers) in front of the x, y, and z unknowns were placed into a matrix A and the unknowns x, y, and z were put into a vector P.

In our case, the vector P happens to be the 3D vector in real space.  Since we know P, the multiplication of matrix A times vector P can be performed and the result is the new vector P’ (P prime) in 3D space.

 

 

To multiply matrix A times matrix B, [ M(A) * M(B) = M(C)], follow the pattern of element multiplications and additions as below.

 

 

 

The elements of Matrix C are as follows and how they were obtained:

 

c(1,1) = a(1,1)*b(1,1) + a(1,2)*b(2,1) + a(1,3)*b(3,1) [first row of M(A) times first column of M(B)]

c(1,2) = a(1,1)*b(1,2) + a(1,2)*b(2,2) + a(1,3)*b(3,2)  [first row of M(A) times second column of M(B)]

c(1,3) = a(1,1)*b(1,3) + a(1,2)*b(2,3) + a(1,3)*b(3,3)  [first row of M(A) times third column of M(B)]

 

c(2,1) = a(2,1)*b(1,1) + a(2,2)*b(2,1) + a(2,3)*b(3,1)  [second row of M(A) times first column of M(B)]

c(2,2) = a(2,1)*b(1,2) + a(2,2)*b(2,2) + a(2,3)*b(3,2)   [second row of M(A) times second column of M(B)]

c(2,3) = a(2,1)*b(1,3) + a(2,2)*b(2,3) + a(2,3)*b(3,3)   [second row of M(A) times third column of M(B)]

 

c(3,1) = a(3,1)*b(1,1) + a(3,2)*b(2,1) + a(3,3)*b(3,1)  [third row of M(A) times first column of M(B)]

c(3,2) = a(3,1)*b(1,2) + a(3,2)*b(2,2) + a(3,3)*b(3,2)   [third row of M(A) times second column of M(B)]

c(3,3) = a(3,1)*b(1,3) + a(3,2)*b(2,3) + a(3,3)*b(3,3)   [third row of M(A) times third column of M(B)]