{VERSION 5 0 "APPLE_PPC_MAC" "5.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 "" -1 256 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 257 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 258 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 259 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 260 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 261 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 262 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 263 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 264 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 266 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 267 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 268 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 269 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 270 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 271 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 272 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 273 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 274 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 275 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Tim es" 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 "Heading 1" 0 3 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }1 0 0 0 8 4 0 0 0 0 0 0 -1 0 }{PSTYLE "Heading 2" 3 4 1 {CSTYLE "" -1 -1 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 8 2 0 0 0 0 0 0 -1 0 }{PSTYLE "" 0 256 1 {CSTYLE "" -1 -1 "" 1 9 0 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 }} {SECT 0 {EXCHG {PARA 4 "" 0 "" {TEXT -1 10 "Animations" }}{PARA 256 " " 0 "" {TEXT -1 31 "by Bob Bradshaw, Ohlone College" }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 54 "There are three forms of two-dimensional animation in " }{TEXT 256 5 "Maple" }{TEXT -1 32 ". The first form is the command " }{TEXT 257 12 "animatecurve" }{TEXT -1 131 ". This command imitates the gradual drawing of a graph \+ that you would see on a graphing calculator. The second form is the co mmand " }{TEXT 258 7 "animate" }{TEXT -1 152 ". This command allows yo u to modify an equation. The third form is through the use of sequence s. This method provides the most control of the animation." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 100 "All thre e of the forms require the use of the plotting subroutines so start by loading this package." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "with(plot s):" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 200 "To see any of the following animations, execute the commands a nd then click once on the picture. You should see a set of VCR-type co ntrols at the top of the screen. Use these to control the animation." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 41 "First w e look at a simple example of the " }{TEXT 259 12 "animatecurve" } {TEXT -1 149 " command. This command will produce animations of standa rd functions or parametric equations. below is an animation of a set o f parametric equations." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 76 "animatec urve([cos(3/2*t)*cos(t),cos(3/2*t)*sin(t),t=0..4*Pi],numpoints=400);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 20 "Now, we look at the " }{TEXT 260 7 "animate" }{TEXT -1 43 " command. \+ In the following example, we use " }{TEXT 261 7 "animate" }{TEXT -1 64 " to see the effects of changing the amplitude of a sine curve.. " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 55 "animate(a*sin(6*x),x=-1..1,a=-4.. 4,view=[-1..1,-4..4]);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 89 "The most powerful method of creating anim ations is through the use of sequences. A basic " }{TEXT 262 8 "sequen ce" }{TEXT -1 32 " command has the following form." }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 16 "seq(i^2,i=1..6);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 19 "We can now use the " }{TEXT 263 8 "sequence" }{TEXT -1 37 " command to generate the plot of sin(" }{TEXT 264 2 "ax" }{TEXT -1 32 ") for three different values of " } {TEXT -1 41 "a. Create the sequence first and name it." }{TEXT -1 1 " \+ " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 55 "bb1:=seq(plot(sin(a*x),x=-6.3.. 6.3,color=blue),a=1..3):" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 38 "The animation is plotted by using the " } {TEXT 266 7 "display" }{TEXT -1 32 " command. If you use the option " }{TEXT 267 16 "insequence=false" }{TEXT -1 58 ", all frames are shown \+ together and there is no animation." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "display(bb1,insequence=false);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 17 "Using the option " }{TEXT 268 15 "insequence=true" }{TEXT -1 32 " shows only one frame at a time." } {TEXT -1 1 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "display(bb1,insequ ence=true);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 " " {TEXT -1 70 "If we create a second sequence, you can compare the res ults of making " }{TEXT 269 10 "insequence" }{TEXT -1 23 " either true or false. " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 57 "bb2:=seq(plot(-sin(a *x),x=-6.3..6.3,color=green),a=1..3):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "display(bb1,bb2,insequence=true);\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 78 "You can also look at the \+ effect of chanign the order of what you are plotting." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "display(bb2,bb1,insequence=true);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 25 "If you cr eate and name a " }{TEXT 270 7 "display" }{TEXT -1 41 " command, these can again be placed in a " }{TEXT 271 7 "display" }{TEXT -1 44 " comm and. This may be a useful time to have " }{TEXT 272 16 "insequence=fal se" }{TEXT -1 1 "." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 43 "displaygreen: =display(bb1,insequence=true):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 42 "d isplayblue:=display(bb2,insequence=true):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 51 "display(displayblue,displaygreen,insequence=false);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 125 "In the following, I first declare a set of parametric functions, \+ the number of frames in the animation, an initial and final " }{TEXT 273 1 "t" }{TEXT -1 19 " value and a delta " }{TEXT 274 1 "t" }{TEXT -1 7 " value." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 124 "xt:=cos(3/2*t)*co s(t);\nyt:=cos(3/2*t)*sin(t);\nnumframes:=60;\ninitialt:=0;\nfinalt:=1 2.56;\ndelta:=(finalt-initialt)/numframes;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 126 "We can create a sequence in which the color is defined using the HUE command, where the HUE is a function of the frame number." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 121 "bb5:=seq(plot([xt,yt,t=initialt+(i-1)*delta..initialt+i*delta],co lor=COLOR(HUE,i/numframes),thickness=3),i=1..numframes):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "display(bb5,insequence=true);\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "display(bb5,insequence=false);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 85 "This is a repeat of the above animation with a slight change in the initial val ue of " }{TEXT 275 1 "t" }{TEXT -1 1 "." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 109 "bb6:=seq(plot([xt,yt,t=initialt..initialt+i*delta],color=COLO R(HUE,i/numframes),thickness=3),i=1..numframes):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "display(bb6,insequence=true);\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "16" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }