{VERSION 2 3 "APPLE_PPC_MAC" "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 "" -1 256 "" 0 1 255 0 0 1 0 1 0 0 0 0 0 0 0 } {CSTYLE "" -1 257 "" 0 1 255 0 0 1 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 258 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 259 "" 0 1 255 0 0 1 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 260 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 261 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{PSTYLE "Norm al" -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 "" 0 256 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }3 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 256 "" 0 "" {TEXT -1 21 "Rigid Transformations" } }{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 127 "Each of the four cells below defines one of the four basic kinds of rigid tra nsformations and then does one or more examples. " }{TEXT 256 105 "Ev aluate each of these four cells now and experiment with each of the fo ur kinds of rigid transformations" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "mirror := x -> [x[1], -x[2]] :\nmirror([1,2]);\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 50 "tran s := (x, a) -> x + a:\ntrans([1, 2], [-1, 3]);\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 158 "rot := (x, theta) ->\n [x[1] * cos( theta) - x[2] * sin(theta),\n x[1] * sin(theta) + x[2] * cos (theta)]:\nrot([1, 2], Pi/2);\nrot([1, 2], Pi);\n" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 32 "ident := x -> x:\nident([3, 4]);\n" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 178 "\nThe next two cells define and d isplay a smiley face. Later on we will explore the way in which image s like this can be transformed using the four basic rigid transformati ons. " }{TEXT 257 31 "Evaluate the next two cells now" }{TEXT -1 2 ". \n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 290 "\nwith(plots):\nwith (plottools):\n\noutline := seq(evalf([2 * cos(2 * Pi * k/40), 2.5 * si n(2 * Pi * k/40)]),\n k = 0..40):\n\nallpoints := [outl ine, [0,0], [-0.5,1], [0.5,1], [-1.0, -0.7],\n \+ [-0.5, -1.2], [0.5, -1.2], [1.0, -0.7]]:\n\noriginal := allpoints: \n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 590 "\n\nface := \n curv e([seq(allpoints[k],k=1..41)], thickness = 3,\n color=COLOR(RGB , 0.4, 0.4, 0.4)):\n\nnose := disk(allpoints[42], 0.12, color=COLO R(RGB, 0.0, 0.0, 0.0)):\nlefteye := disk(allpoints[43], 0.12, color=C OLOR(RGB, 0.0, 0.0, 1.0)):\nrighteye := disk(allpoints[44], 0.12, colo r=COLOR(RGB, 0.0, 0.0, 1.0)):\n\nmouth :=curve([allpoints[45], allp oints[46], allpoints[47],\n allpoints[48]], thickness = 4,\n color=COLOR(RGB, 1.0, 0.0, 0.0)):\n\ndisplay( face, nose, lefteye, righteye, mouth, \n axes=non e, scaling=constrained);\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 161 "The next cell is identical to the preced ing cell except that we have added one line at the beginning of the ce ll. This new line applys the rigid transformation " }{TEXT 258 6 "mir ror" }{TEXT -1 43 " to the smiley face before displaying it. " } {TEXT 259 26 "Evaluate the next cell now" }{TEXT -1 1 "." }}{PARA 0 " " 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 625 "all points := map(mirror, original):\n\nface := \n curve([seq(allpoints[k ],k=1..41)], thickness = 3,\n color=COLOR(RGB, 0.4, 0.4, 0.4)): \n\nnose := disk(allpoints[42], 0.12, color=COLOR(RGB, 0.0, 0.0, 0 .0)):\nlefteye := disk(allpoints[43], 0.12, color=COLOR(RGB, 0.0, 0.0 , 1.0)):\nrighteye := disk(allpoints[44], 0.12, color=COLOR(RGB, 0.0, \+ 0.0, 1.0)):\n\nmouth :=curve([allpoints[45], allpoints[46], allpoin ts[47],\n allpoints[48]], thickness = 4,\n \+ color=COLOR(RGB, 1.0, 0.0, 0.0)):\n\ndisplay(face, nose, leftey e, righteye, mouth, \n axes=none, scaling=constra ined);\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 67 "The most important line in the preceding cell is the firs t line \n\n" }{TEXT 260 49 " allpoints := map(mirror, or iginal):" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 39 "which applies the rigid transformation " }{TEXT 261 6 "mirror" } {TEXT -1 124 " to the points that make up the smiley face.\n\nNow you \+ can use the same ideas to experiment with other rigid transformations. " }}}}{MARK "0 0 0" 21 }{VIEWOPTS 1 1 0 1 1 1803 }