{VERSION 4 0 "SGI MIPS UNIX" "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 "" -1 256 "" 1 18 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 "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 }} {SECT 0 {EXCHG {PARA 4 "" 0 "" {TEXT 256 18 "Self Similar Trees" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 30 "Michael Monagan, October 2005." }} }{EXCHG {PARA 0 "" 0 "" {TEXT -1 100 "This is a program to draw a self -similar tree.\nNB: `plot/color` does not exist in Maple V Release 5. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "BROWN := `plot/color`(b rown);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 346 "drawtree := proc (n,alpha,p,q,s1,c1,s2,c2)\n local v,L,R;\n if n=0 then RETURN( C URVES([p,q]) ) fi;\n v := q-p;\n L := alpha*[c1*v[1]-s1*v[2],s1* v[1]+c1*v[2]];\n R := alpha*[c2*v[1]+s2*v[2],-s2*v[1]+c2*v[2]];\n \+ CURVES([p,q],THICKNESS(n),BROWN),\n drawtree(n-1,alpha,q,q+L,s1,c 1,s2,c2),\n drawtree(n-1,alpha,q,q+R,s1,c1,s2,c2);\nend:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 307 "maketree := proc(n,alpha,th eta,phi)\nlocal t,p,s1,c1,s2,c2;\n if nargs=3 then return maketree( n,alpha,theta,theta) fi;\n t := evalf(theta); s1 := sin(t); c1 := c os(t);\n p := evalf(phi); s2 := sin(p); c2 := cos(p);\n PLOT(d rawtree(n,evalf(alpha),[0,0],[0,1],s1,c1,s2,c2),AXESSTYLE(NONE));\nend :\n " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "lprint( maketree (1,0.8,Pi/5) );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "maketree (6,0.8,Pi/6);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "maketree(9 ,0.75,Pi/5,Pi/7);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}} {MARK "1 0 0" 22 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }