Example 12
Matrices Applied to Two Dimensional
Translations and Rotations

Copyright „ 1993 by Bill Titus, Carleton College, 
Department of Physics and Astronomy, Northfield, MN  55057-4025
September 6, 1993

Topics and Skills

1.  Matrices as lists of lists.
2.  Matrix multiplication and addition.
3.  Formating with  MatrixForm[].
4.  Inverse[].
5.  Chop[].

Problem

Let a two dimensional vector be represented by the column matrix  r  whose components  are  x  and  y  with respect to some x-y coordinate system.

If the coordinate system is translated by an amount  xo  in the  x  direction and  yo  in the  y  direction, then the vector in the new coordinate system is represented by the sum of  r  and the column matrix  ro,  where  ro  has components  -xo  and  -yo.

If the coordinate system is rotated by an angle  c,  then the vector in the new coordinate system is the matrix product of a rotation matrix  rot[c]  and the column matrix  r.  Recall that  rot[c]  has the martix form

cos[c]     sin[c]
                                    -sin[c]     cos[c]

a.  Create symbolic matrices for  r,  ro,  and  rot[c].

b.  Show that a translation followed by a rotation is not the same as a rotation followed by a translation.

c.  Find the inverse of the rotation matrix  rot[c].  Prove that it's indeed the inverse of  rot[c]  by mutiplying it by  rot[c]  and showing that the product is the identity matrix.

d.  Show that two consecutive rotations by angles  c1  and  c2  are the same as a single rotation by the angle  c1 + c2.

Solution - Part a

Step 1 - Using the fact that matrices within MMA are lists of lists, the following code defines symbolic matrices for  r,  ro,  and  rot[c].  Look it over and then activate the cell.

Clear[x, y, xo, yo, c, r, ro, rot]
r  = {x, y}
ro = {-xo, -yo}
rot[c_] = {{Cos[c], Sin[c]}, {-Sin[c], Cos[c]}}

Comment 1

1.  Note that MMA makes no distinction between column and row matrices.

Step 2 - Display the matrices in "standard form" using the MMA function   MatrixForm[].

Comment 2

1.  There are other kinds of "Forms" available in MMA.  What are they?

Solution - Part b

Step 1 - Show that a translation followed by a rotation is not the same as a rotation followed by a translation.  Note that within MMA, matrix multiplication is indicated by a period.  Be sure to simplify your results so that you can easily see that the operations don't commute.

Solution - Part c

Step 1 - Find the inverse of  rot[c]  and call it  rotInv[c].  What MMA command do you think you're going to use?

Comment 1

1.  Note that the denominators are not simplified.

Step 2 - Redefine  rotInv[c]  using  Simplify[]  to make it "pretty" and then display the result in matrix form.  Postfix notation may be useful here.

Comment 2

1.  Why should  Simplify[]  do trig simplification?  (Hint:  Look at its options.)

2.  Some of the "simplification" command, like  Collect[], have 
Trig -> False  and won't do trig simplifications.

Step 3 - Verify that  rotInv[c]  is indeed the inverse of  rot[c]  by showing that their product is the identity matrix.

Comment 3

1.  Sometimes you may have problems multiplying a real matrix by its inverse.  Why?
2.  Try out your conjecture on the following matrix.  What did you find?

                            0.100       0.200
                            0.300       0.001

3.  You can make the product of the matrix and its inverse look nice by using the MMA command  Chop[].  Find out about  Chop[]  and apply it to your matrix product.

Solution - Part d

Step 1 - Show that two consecutive rotations by angles  c1  and  c2  are the same as a single rotation by the angle  c1 + c2.

Save your notebook

Remove any output cells from this notebook and then use  Save As  to store your notebook under the name   myEx12.