(*^
::[ Information =
"This is a Mathematica Notebook file. It contains ASCII text, and can be
transferred by email, ftp, or other text-file transfer utility. It should
be read or edited using a copy of Mathematica or MathReader. If you
received this as email, use your mail application or copy/paste to save
everything from the line containing (*^ down to the line containing ^*)
into a plain text file. On some systems you may have to give the file a
name ending with ".ma" to allow Mathematica to recognize it as a Notebook.
The line below identifies what version of Mathematica created this file,
but it can be opened using any other version as well.";
FrontEndVersion = "Macintosh Mathematica Notebook Front End Version 2.2";
MacintoshStandardFontEncoding;
fontset = title, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, e8, 24, "Times";
fontset = subtitle, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, e6, 18, "Times";
fontset = subsubtitle, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, italic, e6, 14, "Times";
fontset = section, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, grayBox, M22, bold, a20, 18, "Times";
fontset = subsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, blackBox, M19, bold, a15, 14, "Times";
fontset = subsubsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, whiteBox, M18, bold, a12, 12, "Times";
fontset = text, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "";
fontset = smalltext, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 10, "Times";
fontset = input, noPageBreakBelow, nowordwrap, preserveAspect, groupLikeInput, M42, N23, bold, 12, "Courier";
fontset = output, output, inactive, noPageBreakBelow, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L-4, 12, "Courier";
fontset = message, inactive, noPageBreakBelow, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, 12, "Courier";
fontset = print, inactive, noPageBreakBelow, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, 12, "Courier";
fontset = info, inactive, noPageBreakBelow, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, 12, "Courier";
fontset = postscript, PostScript, formatAsPostScript, output, inactive, noPageBreakBelow, nowordwrap, preserveAspect, groupLikeGraphics, M7, l34, w282, h287, 12, "Courier";
fontset = name, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, italic, 10, "Times";
fontset = header, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "";
fontset = leftheader, inactive, L2, 12, "Times";
fontset = footer, inactive, nohscroll, noKeepOnOnePage, preserveAspect, center, M7, 12, "";
fontset = leftfooter, inactive, L2, 12, "Times";
fontset = help, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 10, "Times";
fontset = clipboard, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "";
fontset = completions, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Courier";
fontset = special1, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 14, "Times";
fontset = special2, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "";
fontset = special3, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "";
fontset = special4, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "";
fontset = special5, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "";
paletteColors = 128; automaticGrouping; currentKernel;
]
:[font = title; inactive; preserveAspect; startGroup]
Example 12
Matrices Applied to Two Dimensional
Translations and Rotations
:[font = subsubtitle; inactive; preserveAspect]
Copyright ã 1993 by Bill Titus, Carleton College,
Department of Physics and Astronomy, Northfield, MN 55057-4025
September 6, 1993
;[s]
3:0,0;10,1;11,0;133,-1;
2:2,16,12,Times,2,14,0,0,0;1,16,12,Symbol,0,14,0,0,0;
:[font = section; inactive; preserveAspect; startGroup]
Topics and Skills
:[font = special1; inactive; preserveAspect; endGroup]
1. Matrices as lists of lists.
2. Matrix multiplication and addition.
3. Formating with MatrixForm[].
4. Inverse[].
5. Chop[].
;[s]
7:0,0;92,1;104,0;110,1;119,0;125,1;131,0;133,-1;
2:4,16,12,Times,0,14,0,0,0;3,15,11,Courier,0,14,0,0,0;
:[font = section; inactive; preserveAspect; startGroup]
Problem
:[font = special1; inactive; preserveAspect]
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.
:[font = special1; inactive; preserveAspect]
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.
:[font = special1; inactive; preserveAspect]
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
:[font = special1; inactive; preserveAspect]
cos[c] sin[c]
-sin[c] cos[c]
:[font = special1; inactive; preserveAspect]
a. Create symbolic matrices for r, ro, and rot[c].
:[font = special1; inactive; preserveAspect]
b. Show that a translation followed by a rotation is not the same as a rotation followed by a translation.
:[font = special1; inactive; preserveAspect]
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.
:[font = special1; inactive; preserveAspect; endGroup]
d. Show that two consecutive rotations by angles c1 and c2 are the same as a single rotation by the angle c1 + c2.
:[font = section; inactive; preserveAspect; startGroup]
Solution - Part a
:[font = subsection; inactive; preserveAspect; startGroup]
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.
:[font = input; preserveAspect; endGroup]
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]}}
:[font = subsection; inactive; preserveAspect; startGroup]
Comment 1
:[font = special1; inactive; preserveAspect; endGroup]
1. Note that MMA makes no distinction between column and row matrices.
:[font = subsection; inactive; preserveAspect]
Step 2 - Display the matrices in "standard form" using the MMA function MatrixForm[].
;[s]
3:0,0;74,1;86,0;88,-1;
2:2,16,12,Times,1,14,0,0,0;1,15,11,Courier,1,14,0,0,0;
:[font = subsection; inactive; preserveAspect; startGroup]
Comment 2
:[font = special1; inactive; preserveAspect; endGroup; endGroup]
1. There are other kinds of "Forms" available in MMA. What are they?
:[font = section; inactive; preserveAspect; startGroup]
Solution - Part b
:[font = subsection; inactive; preserveAspect; endGroup]
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.
:[font = section; inactive; preserveAspect; startGroup]
Solution - Part c
:[font = subsection; inactive; preserveAspect]
Step 1 - Find the inverse of rot[c] and call it rotInv[c]. What MMA command do you think you're going to use?
;[s]
5:0,0;30,1;36,0;51,1;60,0;114,-1;
2:3,16,12,Times,1,14,0,0,0;2,15,11,Courier,1,14,0,0,0;
:[font = subsection; inactive; preserveAspect; startGroup]
Comment 1
:[font = special1; inactive; preserveAspect; endGroup]
1. Note that the denominators are not simplified.
:[font = subsection; inactive; preserveAspect]
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.
;[s]
5:0,0;19,1;28,0;37,1;47,0;151,-1;
2:3,16,12,Times,1,14,0,0,0;2,15,11,Courier,1,14,0,0,0;
:[font = subsection; inactive; preserveAspect; startGroup]
Comment 2
:[font = special1; inactive; preserveAspect]
1. Why should Simplify[] do trig simplification? (Hint: Look at its options.)
;[s]
3:0,0;16,1;26,0;83,-1;
2:2,16,12,Times,0,14,0,0,0;1,15,11,Courier,0,14,0,0,0;
:[font = special1; inactive; preserveAspect; endGroup]
2. Some of the "simplification" command, like Collect[], have
Trig -> False and won't do trig simplifications.
;[s]
5:0,0;48,1;57,0;65,1;78,0;115,-1;
2:3,16,12,Times,0,14,0,0,0;2,15,11,Courier,0,14,0,0,0;
:[font = subsection; inactive; preserveAspect]
Step 3 - Verify that rotInv[c] is indeed the inverse of rot[c] by showing that their product is the identity matrix.
;[s]
5:0,0;22,1;31,0;59,1;65,0;121,-1;
2:3,16,12,Times,1,14,0,0,0;2,15,11,Courier,1,14,0,0,0;
:[font = subsection; inactive; preserveAspect; startGroup]
Comment 3
:[font = special1; inactive; preserveAspect]
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
:[font = special1; inactive; preserveAspect; endGroup; endGroup]
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.
;[s]
5:0,0;96,1;102,0;121,1;127,0;166,-1;
2:3,16,12,Times,0,14,0,0,0;2,15,11,Courier,0,14,0,0,0;
:[font = section; inactive; preserveAspect; startGroup]
Solution - Part d
:[font = subsection; inactive; preserveAspect; endGroup]
Step 1 - Show that two consecutive rotations by angles c1 and c2 are the same as a single rotation by the angle c1 + c2.
:[font = section; inactive; preserveAspect; startGroup]
Save your notebook
:[font = special1; inactive; preserveAspect; endGroup; endGroup]
Remove any output cells from this notebook and then use Save As to store your notebook under the name myEx12.
;[s]
5:0,0;57,1;64,0;106,1;112,0;114,-1;
2:3,16,12,Times,0,14,0,0,0;2,15,11,Helvetica,0,14,0,0,0;
^*)