{VERSION 6 0 "IBM INTEL NT" "6.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 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 "Text Output" -1 2 1 {CSTYLE "" -1 -1 "Courier" 1 10 0 0 255 1 0 0 0 0 0 1 3 0 3 0 }1 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 2 6 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 2 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{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 "Normal" -1 256 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }3 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Normal" -1 257 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 256 "" 0 "" {TEXT -1 21 "Jurassic Park Fractal" } }{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 257 "" 0 "" {TEXT -1 50 "By Syl vain Muise, smuise@student.math.uwaterloo.ca" }}{PARA 0 "" 0 "" {TEXT -1 65 "This Maplet displays a fractal used in the \"Jurassic Park\" no vel." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 256 96 " To run this maplet, click the \"Execute-Worksheet\" button in the too l-bar menu (the !!! button)\n" }{TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 78 "restart: with(plots): with(plottools): with(Mapl ets): with(Maplets[Elements]):" }}{PARA 7 "" 1 "" {TEXT -1 50 "Warning , the name changecoords has been redefined\n" }}{PARA 7 "" 1 "" {TEXT -1 58 "Warning, the assigned name arrow now has a global binding\n" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 206 "jurLeft := proc(n) option \+ remember;\n local left, right:\n if n = 1 then\n return [1]:\n e lse\n left := jurLeft(n-1):\n right := jurRight(n-1):\n retur n [op(left), 1, op(right)]:\n end if:\nend proc:" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 209 "jurRight := proc(n) option remember;\n loc al left, right:\n if n = 1 then\n return [-1]:\n else\n left : = jurLeft(n-1):\n right := jurRight(n-1):\n return [op(left), -1 , op(right)]:\n end if:\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 842 "draw := proc(li, randL, randC, C) option remember;\n local X, Y, Angle, newX, newY, i, lines, L:\n X := 0:\n Y := 0:\n \+ Angle := 270:\n newX := 0: newY := -0.25:\n lines[1] := line([X,Y], [newX,newY], color=COLOR(RGB, C[1], C[2], C[3]), thickness=3):\n X := newX: Y := newY:\n for i from 1 to nops(li) do\n Angle := Angle - 90 * li[i]:\n if randL then\n L := rand()/10^12:\n else\n \+ L := 0.25:\n end if:\n newX := newX + L*cos(Angle * Pi / 18 0):\n newY := newY + L*sin(Angle * Pi / 180):\n if randC then\n \+ lines[i+1] := line([X,Y], [newX,newY], color=COLOR(RGB, rand()/10 ^12, rand()/10^12, rand()/10^12), thickness=3):\n else\n lines [i+1] := line([X,Y],[newX,newY], color=COLOR(RGB, C[1], C[2], C[3]), t hickness=3):\n end if:\n X := newX: Y := newY:\n end do:\n seq (lines[i], i = 1..(nops(li) + 1));\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2823 "fractalMaplet := Maplet(\n Window[W1]('title' = \"Fractal\", menubar = MB1, 'layout' = BL1),\n MenuBar[MB1](Menu( \"File\", MenuItem(\"Close\", Shutdown()))),\n BoxLayout[BL1](inset=0 ,\n BoxColumn(inset=0, spacing=0,\n Label(\"If you took a narr ow strip of paper, and kept folding it in half, and then\", font = Fon t(\"times\", 12)),\n Label(\"unfolded it, you would get the follo wing fractal. But achieving the fractal\", font = Font(\"times\", 12)) ,\n Label(\"is much easier with the help of this Maplet.\", font \+ = Font(\"helvetica\", 12)),\n Label(\"It can be recursively defin ed as a list of right of left turns as follows: \", font = Font(\"time s\", 12)),\n Label(\"1. The middle turn is always a right turn. \+ \", font = Font(\"helvetica\", 12)), \n Label(\"2. The turns to t he left of the middle are the turns of the iteration before. \", font \+ = Font(\"times\", 12)),\n Label(\"3. The turns to the right of th e middle are opposites of the ones to the left.\", font = Font(\"times \", 12)),\n Plotter[P1](),\n Label(\"This fractal is illustr ated in the novel \"\"Jurassic Park\"\", by Michael Crichton. \", font = Font(\"times\", 12)) \n ),\n BoxColumn(inset=0, spacing=0, \n BoxRow(inset=0,spacing=0,\n \"Number of Iterations:\"\n ),\n BoxRow(inset=0, spacing=0,\n ComboBox[n](\"1\", [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10 \", \"11\", \"12\", \"13\", \"14\", \"15\"])\n ),\n BoxRow(i nset=0, spacing=0,\n CheckBox[randL](false, caption=\"Random Le ngth\")\n ),\n BoxRow(inset=0, spacing=0,\n CheckBox[ randC](false, caption=\"Random Color\")\n ),\n BoxRow(inset= 0, spacing=0,\n BoxColumn(inset=0, spacing=0,\n \"Red \",\n TextField[r](\"0\",width=2, halign=right, onchange=SetO ption( target=rs, Argument(r) )),\n Slider[rs](filled=true, l ower=0, majorticks=20, minorticks=5, orientation=vertical, snapticks=f alse, upper=255, value=0, onchange=SetOption( target=r, Argument( rs) \+ ))\n ),\n BoxColumn(inset=0, spacing=0,\n \"Gre en\",\n TextField[g](\"0\",width=2, halign=right, onchange=Se tOption(target=gs, Argument(g))),\n Slider[gs](filled=true, l ower=0, majorticks=20, minorticks=5, orientation=vertical, snapticks=f alse, upper=255, value=0, onchange=Evaluate(target=g, Argument(gs)))\n ),\n BoxColumn(inset=0, spacing=0,\n \"Blue\", \n TextField[b](\"0\",width=2, halign=right, onchange=SetOpti on(target=bs, Argument(b))),\n Slider[bs](filled=true,lower=0 ,majorticks=20,minorticks=5, orientation=vertical, snapticks=false, u pper=255, value=0, onchange=Evaluate(target=b,Argument(bs)))\n \+ )\n ),\n Button[go](\"Do it!\", onclick=A1)\n )\n ),\n Action[A1](Evaluate(P1 = 'display(draw(jurLeft(n),randL,randC,[r/255 ,g/255,b/255]), axes=boxed, scaling=constrained)'))\n):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "Display(fractalMaplet);" }}{PARA 6 "" 1 "" {TEXT -1 38 "Initializing Java runtime environment." }}}} {MARK "6 1" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }