{VERSION 4 0 "IBM INTEL NT" "4.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "2D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 256 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 257 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Warning" -1 7 1 {CSTYLE "" -1 -1 "Courier " 1 10 0 0 255 1 2 2 2 2 2 1 1 1 3 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 } {PSTYLE "Maple Output" -1 11 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }3 3 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Maple Plot " -1 13 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 } 3 1 0 0 0 0 1 0 1 0 2 2 0 1 }} {SECT 0 {EXCHG {PARA 0 "" 0 "" {TEXT 256 29 "Matrix Manipulation Works heet" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 115 "Start by loading the lin alg (linear algebra) package to run matrix formula (don't worry about \+ the warning message.)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "restart;\n with(linalg):" }}{PARA 7 "" 1 "" {TEXT -1 80 "Warning, the protected n ames norm and trace have been redefined and unprotected\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 247 "Create our matrix with which we will man ipulate our image. In this example, let's double the height of the im age and flip it across the y-axis. For this, (1,0) will move to (-1,0 ) and (0,1) will move to (0,2). Therefore, the matrix is as below." } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "A:=matrix([[-1,0],[0,2]]);" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"AG-%'matrixG6#7$7$!\"\"\"\"!7$F+\" \"#" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 205 "Let's set up a list of li sts, which can be plotted in Maple. Remember, this is an object of th e type listlist, or a list of smaller lists (in this case, we have li sts with two elements, the coordinates)." }{MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 90 "f1 := [[0,0], [0,5], [3,5], [3,4], [1,4], [1,3],\n [2,3], [2,2], [1,2], [1,0], [0,0]];" }}{PARA 11 "" 1 " " {XPPMATH 20 "6#>%#f1G7-7$\"\"!F'7$F'\"\"&7$\"\"$F)7$F+\"\"%7$\"\"\"F -7$F/F+7$\"\"#F+7$F2F27$F/F27$F/F'F&" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 110 "Here's how you plot a list of lists. We duplicated the first \+ point at the end so that the last line is drawn." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 80 "plot(f1, color=blue, thickness=2, view=[-10..10, -10. .10], scaling=constrained);" }}{PARA 13 "" 1 "" {GLPLOT2D 400 300 300 {PLOTDATA 2 "6(-%'CURVESG6#7-7$$\"\"!F)F(7$F($\"\"&F)7$$\"\"$F)F+7$F.$ \"\"%F)7$$\"\"\"F)F17$F4F.7$$\"\"#F)F.7$F8F87$F4F87$F4F(F'-%+AXESLABEL SG6$Q!6\"F@-%*THICKNESSG6#F9-%(SCALINGG6#%,CONSTRAINEDG-%'COLOURG6&%$R GBGF(F($\"*++++\"!\")-%%VIEWG6$;$!#5F)$\"#5F)FS" 1 2 0 1 10 2 2 6 1 4 1 1.000000 45.000000 45.000000 0 0 "Curve 1" }}}}{EXCHG {PARA 0 "" 0 " " {TEXT -1 360 "Now the tricky part. In order to manipulate each poin t, we need to conver the listlist to an array (basically a large matri x). After we evalulate the matrix multiplication ( evalm(...) ) then \+ we convert the result back into a listlist. This is the way I discove red; I hope for the sake of Maple usability that there's an easier way . For now, just use this." }{MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 54 "f2:=convert(evalm(convert(f1, array) &* A), listlist) ;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#f2G7-7$\"\"!F'7$F'\"#57$!\"$F) 7$F+\"\")7$!\"\"F-7$F/\"\"'7$!\"#F17$F3\"\"%7$F/F57$F/F'F&" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 169 "...and plotting the resulting set of poi nts gives is what we desired in the first place--the image stretched v ertically by a factor of two and flipped across the y-axis." } {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 79 "plot(f2, color= red, thickness=3, view=[-10..10, -10..10], scaling=constrained);" }} {PARA 13 "" 1 "" {GLPLOT2D 400 300 300 {PLOTDATA 2 "6(-%'CURVESG6#7-7$ $\"\"!F)F(7$F($\"#5F)7$$!\"$F)F+7$F.$\"\")F)7$$!\"\"F)F17$F4$\"\"'F)7$ $!\"#F)F77$F:$\"\"%F)7$F4F=7$F4F(F'-%+AXESLABELSG6$Q!6\"FD-%*THICKNESS G6#\"\"$-%(SCALINGG6#%,CONSTRAINEDG-%'COLOURG6&%$RGBG$\"*++++\"!\")F(F (-%%VIEWG6$;$!#5F)F+FX" 1 2 0 1 10 3 2 6 1 4 1 1.000000 45.000000 45.000000 0 0 "Curve 1" }}}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 82 "If we \+ so desired, we could plot both at the same time! We simply set it up \+ as so:" }{MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 97 "plot( \{f1, f2\}, color=[blue, red], thickness=[1,3], view=[-10..10, -10..10 ], scaling=constrained);" }}{PARA 13 "" 1 "" {GLPLOT2D 400 300 300 {PLOTDATA 2 "6'-%'CURVESG6%7-7$$\"\"!F)F(7$F($\"\"&F)7$$\"\"$F)F+7$F.$ \"\"%F)7$$\"\"\"F)F17$F4F.7$$\"\"#F)F.7$F8F87$F4F87$F4F(F'-%'COLOURG6& %$RGBGF(F($\"*++++\"!\")-%*THICKNESSG6#F5-F$6%7-F'7$F($\"#5F)7$$!\"$F) FK7$FN$\"\")F)7$$!\"\"F)FQ7$FT$\"\"'F)7$$!\"#F)FW7$FZF17$FTF17$FTF(F'- F>6&F@FAF(F(-FE6#F/-%+AXESLABELSG6$Q!6\"F`o-%(SCALINGG6#%,CONSTRAINEDG -%%VIEWG6$;$!#5F)FKFio" 1 2 0 1 10 0 2 9 1 4 1 1.000000 45.000000 45.000000 0 0 "Curve 1" "Curve 2" }}}}{EXCHG {PARA 0 "" 0 "" {TEXT 257 15 "Other examples:" }{MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 85 "Stretch matrix by two in horizontal direction and shrink \+ by two in vertical direction" }{MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 182 "A3 := matrix([[2,0],[0,1/2]]);\nf3:=convert(evalm(co nvert(f1, array) &* A3), listlist):\nplot(\{f1,f3\}, color=[blue,red], thickness=[1,3], view=[-10..10, -10..10], scaling=constrained);" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#>%#A3G-%'matrixG6#7$7$\"\"#\"\"!7$F+# \"\"\"F*" }}{PARA 13 "" 1 "" {GLPLOT2D 400 300 300 {PLOTDATA 2 "6'-%'C URVESG6%7-7$$\"\"!F)F(7$F($\"\"&F)7$$\"\"$F)F+7$F.$\"\"%F)7$$\"\"\"F)F 17$F4F.7$$\"\"#F)F.7$F8F87$F4F87$F4F(F'-%'COLOURG6&%$RGBGF(F($\"*++++ \"!\")-%*THICKNESSG6#F5-F$6%7-F'7$F($\"3++++++++D!#<7$$\"\"'F)FK7$FOF8 F:7$F8$\"3++++++++:FM7$F1FS7$F1F47$F8F47$F8F(F'-F>6&F@FAF(F(-FE6#F/-%+ AXESLABELSG6$Q!6\"Fjn-%(SCALINGG6#%,CONSTRAINEDG-%%VIEWG6$;$!#5F)$\"#5 F)Fco" 1 2 0 1 10 0 2 9 1 4 1 1.000000 45.000000 45.000000 0 0 "Curve \+ 1" "Curve 2" }}}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 51 "Skew image - send (1,0) to (1,1) and (0,1) to (0,1)" }{MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 182 "A4 := matrix([[1,1],[0,1]]);\nf4 := convert(eva lm(convert(f1, array) &* A4), listlist):\nplot(\{f1,f4\}, color=[blue, red], thickness=[1,3], view=[-10..10, -10..10], scaling=constrained); " }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#A4G-%'matrixG6#7$7$\"\"\"F*7$\" \"!F*" }}{PARA 13 "" 1 "" {GLPLOT2D 400 300 300 {PLOTDATA 2 "6'-%'CURV ESG6%7-7$$\"\"!F)F(7$F($\"\"&F)7$$\"\"$F)F+7$F.$\"\"%F)7$$\"\"\"F)F17$ F4F.7$$\"\"#F)F.7$F8F87$F4F87$F4F(F'-%'COLOURG6&%$RGBGF(F($\"*++++\"! \")-%*THICKNESSG6#F5-F$6%7-F'F*7$F.$\"\")F)7$F.$\"\"(F)7$F4F+F37$F8F+7 $F8F1F67$F4F4F'-F>6&F@FAF(F(-FE6#F/-%+AXESLABELSG6$Q!6\"Fen-%(SCALINGG 6#%,CONSTRAINEDG-%%VIEWG6$;$!#5F)$\"#5F)F^o" 1 2 0 1 10 0 2 9 1 4 1 1.000000 45.000000 45.000000 0 0 "Curve 1" "Curve 2" }}}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 83 "Rotate Image counter-clockwise 90 degrees - sen d (1,0) to (0,1) and (0,1) to (-1,0)" }{MPLTEXT 1 0 0 "" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 184 "A5 := matrix([[0,1], [-1,0]]);\nf5 := convert (evalm(convert(f1, array) &* A5), listlist):\nplot(\{f1,f5\}, color=[b lue,red], thickness=[1,3], view=[-10..10, -10..10], scaling=constraine d);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#A5G-%'matrixG6#7$7$\"\"!\"\" \"7$!\"\"F*" }}{PARA 13 "" 1 "" {GLPLOT2D 400 300 300 {PLOTDATA 2 "6'- %'CURVESG6%7-7$$\"\"!F)F(7$F($\"\"&F)7$$\"\"$F)F+7$F.$\"\"%F)7$$\"\"\" F)F17$F4F.7$$\"\"#F)F.7$F8F87$F4F87$F4F(F'-%'COLOURG6&%$RGBGF(F($\"*++ ++\"!\")-%*THICKNESSG6#F5-F$6%7-F'7$$!\"&F)F(7$FKF.7$$!\"%F)F.7$FOF47$ $!\"$F)F47$FSF87$$!\"#F)F87$FWF47$F(F4F'-F>6&F@FAF(F(-FE6#F/-%+AXESLAB ELSG6$Q!6\"F\\o-%(SCALINGG6#%,CONSTRAINEDG-%%VIEWG6$;$!#5F)$\"#5F)Feo " 1 2 0 1 10 0 2 9 1 4 1 1.000000 45.000000 45.000000 0 0 "Curve 1" "C urve 2" }}}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 11 "Brian Abram" }}{PARA 0 "" 0 "" {TEXT -1 26 "University of Pennsylvania" }{MPLTEXT 1 0 0 "" }}}}{MARK "0 0 0" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }