diff options
author | Karl Berry <karl@freefriends.org> | 2019-10-16 20:55:44 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-10-16 20:55:44 +0000 |
commit | abc0bc868286ffdfc3b7d6e0717cd7b2c35f7d6a (patch) | |
tree | 0af60efa125372c1240326e4b775264cfbcc3eb4 /Master/texmf-dist/doc/latex/circuit-macros/examples/Sierpinski.m4 | |
parent | a6439a9cf26d146fb436c26e141a900ee2152007 (diff) |
circuit-macros (16oct19)
git-svn-id: svn://tug.org/texlive/trunk@52410 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/circuit-macros/examples/Sierpinski.m4')
-rw-r--r-- | Master/texmf-dist/doc/latex/circuit-macros/examples/Sierpinski.m4 | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/Master/texmf-dist/doc/latex/circuit-macros/examples/Sierpinski.m4 b/Master/texmf-dist/doc/latex/circuit-macros/examples/Sierpinski.m4 index f9bad102e0d..7fbf13bf15e 100644 --- a/Master/texmf-dist/doc/latex/circuit-macros/examples/Sierpinski.m4 +++ b/Master/texmf-dist/doc/latex/circuit-macros/examples/Sierpinski.m4 @@ -1,7 +1,8 @@ .PS # Sierpinski.m4 gen_init -`define Sierpinski' { +[ + define Sierpinski { if $1 > 0.04 then { d = $1/2-lh shade(1,line from $2+(d/2,d/2*s3+lw*2) right d/2 up d/2*s3 then left d*2 \ @@ -22,6 +23,32 @@ gen_init d = r/2-lh shade(0,line from A+(0,lw) right d then up d*s3 left d then down d*s3 left d\ then right d ) - psset_(linecolor=white) + ifpstricks(`psset_(linecolor=white)') Sierpinski(r/2,A) + + ifpstricks(`psset_(linecolor=black)') + thicklines_ + ] + +# CayleyGraph.m4 +[ +define CayleyGraph { + if $3 > 0 then { + { line to Here+(cosd($2),sind($2))*($1) + exec sprintf("CayleyGraph(%g,%g,%g);",0.5*($1),$2,$3-1); } + { line to Here+(cosd($2+90),sind($2+90))*($1) + exec sprintf("CayleyGraph(%g,%g,%g);",0.5*($1),$2+90,$3-1); } + { line to Here+(cosd($2-90),sind($2-90))*($1) + exec sprintf("CayleyGraph(%g,%g,%g);",0.5*($1),$2-90,$3-1); } + } + } + + size = 2 + depth = 6 + for t=0 to 270 by 90 do { + line from (0,0) to (cosd(t),sind(t)); + { exec sprintf("CayleyGraph(%g,%g,%g);",size/4,t,depth); } + } + ] with .sw at last [].se+(-0.25,0) + .PE |