{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 1 } {CSTYLE "" -1 257 "Helvetica" 0 1 0 0 0 0 0 0 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 "Normal" -1 256 1 {CSTYLE "" -1 -1 "Helvetica" 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 }} {SECT 0 {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}}{EXCHG {PARA 256 "" 0 "" {TEXT 256 24 "Fractals with L-systems:" }}{PARA 256 "" 0 "" {TEXT -1 18 "f means forward" }}{PARA 256 "" 0 "" {TEXT -1 127 "p denotes a rotation by alpha radiants (p stands for plus)\nm denotes a rotation by - alpha radiants (m stands for minus)" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 475 "fr actal:=proc(axiom::list, rule::procedure, steps::integer, alpha::realc ons)\nlocal i,word,points,angle,xx,yy;\nword:=axiom;\nfor i from 1 to \+ steps do\n word:=map(rule,word)\nod;\nangle:=0; xx:=0; yy:=0;\npoint s:=[xx,yy];\nfor i in word do\n if i=p then angle:=angle+alpha;\n \+ elif i=m then angle:=angle-alpha;\n elif i=f then \n xx:=xx+cos( angle);\n yy:=yy+sin(angle);\n points:=points,[xx,yy]\n fi; \nod;\nplot([points], axes=none, scaling=CONSTRAINED, color=navy)\nend :\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 257 26 "a first substitutuion rul e" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 50 "rule1:=a->subs(f=(f,p,f,m,f,m, f,f,p,f,p,f,m,f),a);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "fra ctal([f],rule1,2,Pi/2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 38 " fractal([f,p,f,p,f,p,f],rule1,2,Pi/2);" }}}{EXCHG {PARA 256 "" 0 "" {TEXT -1 46 "the substitution rule for Koch's frost pattern" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 41 "rulekoch:=a->subs(f=(f,p,f,m,m,f,p,f),a); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "fractal([f],rulekoch,1, Pi/3);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 41 "fractal([f,m,m,f, m,m,f],rulekoch,3,Pi/3);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 41 "fractal([f,p,p,f,p,p,f],rulekoch,3,Pi/3);" }}}{EXCHG {PARA 256 "" 0 " " {TEXT -1 25 "another substitution rule" }{MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 62 "rule2:=a->subs(x=(x,f,m,f,p,f,m,x,f,p,f,p ,x,f,m,f,p,f,m,x),a);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "fr actal([x,x,x,x],rule2,2,Pi/2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 42 "fractal([f,p,x,f,p,f,p,x,f],rule2,3,Pi/2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "1 0 0" 4 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }