{VERSION 5 0 "SUN SPARC SOLARIS" "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 "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "2D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 256 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }{PSTYLE "Normal " -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{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 "Warning" 2 7 1 {CSTYLE "" -1 -1 "" 0 1 0 0 255 1 0 0 0 0 0 0 1 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Maple O utput" 0 11 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }3 3 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Maple Plot" 0 13 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }3 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 0 256 1 {CSTYLE "" -1 -1 "" 1 14 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }3 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 0 257 1 {CSTYLE " " -1 -1 "" 1 14 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }3 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {PARA 257 "" 0 "" {TEXT -1 18 "ACCESS - July 2001" }}{PARA 256 "" 0 "" {TEXT -1 32 "Twig example with test procedure" }{TEXT 256 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 376 "I n order to make the twig from yesterday's notes, as well as more compl icated examples, it is nice to have a test procedure to make sure you \+ have picked your affine maps correctly (and to help you adjust them la ter if necessary.) The procedure TESTMAP below, takes an affine functi on as its input, and the result is a mapping -L picture like the ones \+ in the fractal templates." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "restart: " }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "with(plots):\nDigits:=4:" }}{PARA 7 "" 1 "" {TEXT -1 50 "Warning, the name changecoords has been redefined\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 799 "TESTMAP:=proc(f) #this procedure lets you test individual\n #functions in your itera ted function system\n local S, #corners of unit square\n L, \+ #corners of letter L\n Sq, #unit square\n Llet, #letter L\n AS, #transf of square corners\n ASq,#transf of squa re\n AL, #transf of L corners\n ALlet; #transf of lette r L\nS:=[[0,0],[0,1],[1,1] ,[1,0]];\nL:=[[.1,.9],[.1,.75],[.2,.75],[.2 ,.775],[.125,.775],[.125,.9]]:\nSq:=polygonplot(S): #polygonplot conne cts the dots!\nLlet:=polygonplot(L):\nAS:=map(f,S):\nAL:=map(f,L):\nAS q:=polygonplot(AS):\nALlet:=polygonplot(AL):\n #finally, display the unit square, the letter L,\n #and how they are transformed by f:\nd isplay(\{Sq,Llet,ASq,ALlet\},scaling=constrained,\ntitle=`test picture `);\nend:\n\n " }}}{PARA 0 "" 0 "" {TEXT -1 46 "Here is the sta ndard affine map, which encodes" }}{EXCHG {PARA 11 "" 1 "" {XPPMATH 20 "6#/-%(AFFINE1G6#-%'matrixG6#7$7#%\"xG7#%\"yG,&*&-F(6#7$7$%\"aG%\"b G7$%\"cG%\"dG\"\"\"F'F:F:-F(6#7$7#%\"eG7#%\"fGF:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 97 "AFFINE1:=proc(X,a,b,c,d,e,f)\nRETURN(evalf([a *X[1]+b*X[2]+e,\n c*X[1]+d*X[2]+f]));\nend:" }}}{PARA 0 " " 0 "" {TEXT -1 136 "And in case you want to use it, an alternative ve rsion called AFFINE2 which lets you specify scaling factors and roatio n angles instead;" }}{EXCHG {PARA 11 "" 1 "" {XPPMATH 20 "6#-%(AFFINE2 G6#/-%'matrixG6#7$7#%\"xG7#%\"yG,&*&-F(6#7$7$*&%\"rG\"\"\"-%$cosG6#%&a lphaGF7,$*&%\"sGF7-%$sinG6#%%betaGF7!\"\"7$*&F6F7-F@F:F7*&F>F7-F9FAF7F 7F'F7F7-F(6#7$7#%\"eG7#%\"fGF7" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 125 "AFFINE2:=proc(X,r,alpha,s,beta,e,f)\nRETURN(AFFINE1(X,r*cos(a lpha),-s*sin(beta),\n r*sin(alpha),s*cos(beta),e,f));\nend:" } }}{PARA 0 "" 0 "" {TEXT -1 338 "In the following example I tried to re produce the mapping templates which gave the twig shown in Monday's no tes, which came from Peitgen's book. It took several tries to get it \+ approximately right, and then a number of readjustments to make the br anches match up correctly. What you see are the final parameter value s which were chosen." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 38 "f1:= P->AFFINE1(P,.4,.4,.4,-.4,.28,.6);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6# >%#f1Gf*6#%\"PG6\"6$%)operatorG%&arrowGF(-%(AFFINE1G6)9$$\"\"%!\"\"F0F 0$!\"%F2$\"#G!\"#$\"\"'F2F(F(F(" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "TESTMAP(f1);" }}{PARA 13 "" 1 "" {GLPLOT2D 349 262 262 {PLOTDATA 2 "6(-%)POLYGONSG6#7&7$$\"\"!F)F(7$F($\"\"\"F)7$F+F+7$F+F(-F $6#7(7$$F,!\"\"$\"\"*F47$F3$\"#v!\"#7$$\"\"#F4F87$F<$\"$v(!\"$7$$\"$D \"FAF?7$FCF5-F$6#7&7$$\"#GF:$\"\"'F47$$\"#oF:F<7$$\"$3\"F:FL7$FO$\"#5F 4-F$6#7(7$FOFJ7$$\"$?'FA$\"$S$FA7$$\"$g'FA$\"$!QFA7$$\"%+n!\"%$\"%+PFb o7$$\"%+kFbo$\"%+MFbo7$$\"%+pFbo$\"%+HFbo-%&TITLEG6#%-test~pictureG-%( SCALINGG6#%,CONSTRAINEDG" 1 2 0 1 10 0 2 9 1 4 1 1.000000 45.000000 45.000000 0 0 "Curve 1" "Curve 2" "Curve 3" "Curve 4" }}}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 56 "f2:=P->AFFINE1(P,.5,.01 ,.1,.01 ,-. 15,.29);\nTESTMAP(f2);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#f2Gf*6#% \"PG6\"6$%)operatorG%&arrowGF(-%(AFFINE1G6)9$$\"\"&!\"\"$\"\"\"!\"#$F4 F2F3$!#:F5$\"#HF5F(F(F(" }}{PARA 13 "" 1 "" {GLPLOT2D 349 262 262 {PLOTDATA 2 "6(-%)POLYGONSG6#7&7$$\"\"!F)F(7$F($\"\"\"F)7$F+F+7$F+F(-F $6#7(7$$F,!\"\"$\"\"*F47$F3$\"#v!\"#7$$\"\"#F4F87$F<$\"$v(!\"$7$$\"$D \"FAF?7$FCF5-F$6#7&7$$!#:F:$\"#HF:7$$!#9F:$\"#IF:7$$\"#OF:$\"#SF:7$$\" #NF:$\"#RF:-F$6#7(7$$!#\"*FA$\"$4$FA7$$!$D*!\"%$\"%vIFbo7$$!$D%Fbo$\"% vJFbo7$$!$A%Fbo$\"%yJFbo7$$!%vz!\"&$\"%-JFbo7$$!$&yFbo$\"%:JFbo-%&TITL EG6#%-test~pictureG-%(SCALINGG6#%,CONSTRAINEDG" 1 2 0 1 10 0 2 9 1 4 1 1.000000 45.000000 45.000000 0 0 "Curve 1" "Curve 2" "Curve 3" "Curv e 4" }}}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 55 "f3:=P->AFFINE1(P,.4 ,-.1 ,0 ,-.3 ,.44,.46);\nTESTMAP(f3);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#f3Gf*6#%\"PG6\"6$%)operatorG%&arrowGF(-%(AFFINE1G6)9$$\"\"%!\"\" $F2F2\"\"!$!\"$F2$\"#W!\"#$\"#YF9F(F(F(" }}{PARA 13 "" 1 "" {GLPLOT2D 349 262 262 {PLOTDATA 2 "6(-%)POLYGONSG6#7&7$$\"#W!\"#$\"#YF*7$$\"#MF* $\"#;F*7$$\"#uF*F07$$\"#%)F*F+-F$6#7(7$$\"#RF*$\"#>F*7$$\"$0%!\"$$\"$N #FC7$$\"$X%FCFD7$$\"%DW!\"%$\"%vAFL7$$\"%DTFLFM7$$\"%+SFLF>-F$6#7&7$$ \"\"!FZFY7$FY$\"\"\"FZ7$FfnFfn7$FfnFY-F$6#7(7$$Fgn!\"\"$\"\"*F_o7$F^o$ \"#vF*7$$\"\"#F_oFco7$Ffo$\"$v(FC7$$\"$D\"FCFio7$F\\pF`o-%&TITLEG6#%-t est~pictureG-%(SCALINGG6#%,CONSTRAINEDG" 1 2 0 1 10 0 2 9 1 4 1 1.000000 45.000000 45.000000 0 0 "Curve 1" "Curve 2" "Curve 3" "Curve \+ 4" }}}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "S:=\{[0,0]\};" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"SG<#7$\"\"!F'" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 91 "for i from 1 to 9 do\nS1:=map(f1,S):\nS2:=ma p(f2,S);\nS3:=map(f3,S);\nS:=`union`(S1,S2,S3);\nod:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 60 "pointplot(S,scaling=constrained,symbol=point,\ntitle=`twig`);" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "20 0 0" 0 } {VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }