{VERSION 2 3 "SUN SPARC SOLARIS" "2.3" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 }{CSTYLE "Hyperlink" -1 17 "" 0 1 0 128 128 1 0 0 1 0 0 0 0 0 0 } {CSTYLE "2D Comment" 2 18 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE " " -1 256 "" 1 18 0 0 0 0 0 1 0 0 0 0 0 0 0 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Heading 1" 0 3 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 0 0 0 0 0 0 0 }1 0 0 0 6 6 0 0 0 0 0 0 -1 0 }{PSTYLE "Title" 0 18 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 1 0 0 0 0 0 0 }3 0 0 -1 12 12 0 0 0 0 0 0 19 0 }} {SECT 0 {EXCHG {PARA 18 "" 0 "" {TEXT 256 35 "Linear Transformations w ith Maple V" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 69 "This is a short introduction to linear tranformations with Mapl e V. " }}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 9 "Load the " }{HYPERLNK 17 "linalg" 2 "linalg" "" }{TEXT -1 9 " package." }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 41 "First one should load the linalg package." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "with(lina lg):" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 32 "Plotting a Linear Trans formation" }}{PARA 0 "" 0 "" {TEXT -1 61 "One can show what a linear t ransformation does to a polytope." }}{PARA 0 "" 0 "" {TEXT -1 64 "The \+ following shows what a transformation does to a unit square." }} {EXCHG {PARA 0 "" 0 "" {TEXT -1 90 "First one writes the transformatio n T as a matrix and lists the vertices of a unit square." }}{PARA 0 " " 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 63 "T := matrix( [[1,2],[2,1]]);\nlist1 := [[0,0],[1,0],[1,1],[0,1]];" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 91 "One can plot the unit square as a polygon. The \+ routines used are and . Here the polygon " }}{PARA 0 "" 0 "" {TEXT -1 12 "is plotted. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 " " {TEXT -1 83 "Since the polygon will be used again later, it is defin ed as a plot structure to be" }}{PARA 0 "" 0 "" {TEXT -1 16 "displayed later." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 135 "with(plottools,polygon):with(plots,display):\np1 := polygon(l ist1,color=green, linestyle=3, thickness=2):\ndisplay(p1,view=[0..2,0. .2]);\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 1 "." }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 6 "Using " }{HYPERLNK 17 "map" 2 "map" "" }{TEXT -1 71 ", one can apply T to each of the points to get an new list of vert ices " }}{PARA 0 "" 0 "" {TEXT -1 4 "and " }{HYPERLNK 17 "convert" 2 " convert" "" }{TEXT -1 42 " the vectors back to lists for plotting. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 74 "The ima ge of the unit square can be plotted with the original unit square." } }{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 135 "l ist2 := map(convert,(map(multiply,list1,T)),list);\ndisplay(\{p1,polyg on(list2,color=blue, linestyle=3, thickness=2)\},view=[0..4,0..4]);" } }}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 33 "Animating a Linear Transformat ion" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 81 "An imating the transformation to show how the transformation alters a uni t square " }}{PARA 0 "" 0 "" {TEXT -1 88 "is more difficult. The foll owing is one way of demonstrating what the T from above does" }}{PARA 0 "" 0 "" {TEXT -1 100 "to the unit square. The animation will change color if there is a reflection in the transformation." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 84 "One generates a list of polygons and then animates them using the display command. \+ " }}{PARA 0 "" 0 "" {TEXT -1 76 "The details are somewhat complicated , so you may ignore how the polygons are" }}{PARA 0 "" 0 "" {TEXT -1 10 "generated." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 74 "To see the animation, select the polt and use the tool ba r that appears on" }}{PARA 0 "" 0 "" {TEXT -1 12 "your window." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 661 "po lylist := []:\nI2 := diag(1,1):\nfor lambda from 0 by 1/20 to 1 do\n \+ \n # Generate intermediate matrices.\n\n mat := evalf(evalm(((1-l ambda)*I2) &+ (lambda*T)));\n\n # Apply the transformation to the po ints,\n # generate a polytope with a color to indicate \n # the or ientation, and add it to the list.\n\n list2 := map(evalm,(map(multi ply,list1,mat)));\n list2 := map(convert,list2,list);\n if det(mat ) > 0 then Color:='blue'; else Color:='red' fi;\n polylist := eval([ op(polylist),polygon(list2,color=Color,linestyle=3,\n t hickness=2)]);\n od:\n\n# Display the polygons in sequence.\n\ndisp lay(polylist,insequence=true,scaling=constrained);" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 16 "Simple Exercises" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 30 "Plot what the transformations " }{XPPEDIT 18 0 "A(x,y)=(x ,-2y)" "/-%\"AG6$%\"xG%\"yG6$F&,$*&\"\"#\"\"\"F'F,!\"\"" }{TEXT -1 2 " , " }{XPPEDIT 18 0 "B(x,y)=(x+y,2x+2y)" "/-%\"BG6$%\"xG%\"yG6$,&F&\"\" \"F'F*,&*&\"\"#F*F&F*F**&\"\"#F*F'F*F*" }{TEXT -1 4 " and" }}{PARA 0 " " 0 "" {TEXT -1 1 " " }{XPPEDIT 18 0 "C (x,y)=(1/sqrt(2))(x+y,x-y)" "/ -%\"CG6$%\"xG%\"yG-*&\"\"\"\"\"\"-%%sqrtG6#\"\"#!\"\"6$,&F&F+F'F+,&F&F +F'F0" }{TEXT -1 49 " do to a unit square. How would you describe, in " }}{PARA 0 "" 0 "" {TEXT -1 29 "words, these transformations?" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 92 "Animate what the transformations C = [[0,1],[-1,0]] and E = [[-1,0],[0,1]] do the the square" }}{PARA 0 "" 0 "" {TEXT -1 82 "0<=x<=1 and 0<=y<=1. (Do not print the animation s!!!) Explain what is happening." }}}}}{MARK "4" 0 }{VIEWOPTS 1 1 0 1 1 1803 }