diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /info/examples/lgc2/4-4-7.mp |
Initial commit
Diffstat (limited to 'info/examples/lgc2/4-4-7.mp')
-rw-r--r-- | info/examples/lgc2/4-4-7.mp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/info/examples/lgc2/4-4-7.mp b/info/examples/lgc2/4-4-7.mp new file mode 100644 index 0000000000..4ca0cdac3c --- /dev/null +++ b/info/examples/lgc2/4-4-7.mp @@ -0,0 +1,25 @@ +% --- start of displayed preamble in the book --- + +% --- end of displayed preamble in the book --- +% graphic converted to gray in book using 'color2gray' +defaultfont:="ptmr8r"; +warningcheck:=0; +beginfig(1) +numeric psi,iter,c,r,t,cv; +path p; +psi=137.6; +iter=200; +c=5; +r=0; +for i=iter downto 1: + t:=sqrt(i); + r:=(r+psi) mod 360; + cv:=cosd((i/iter)*90); + p:=((0,0)--(t,1)-- + (t+1,0)--(t,-1)--cycle) + rotated r; + fill p scaled c withcolor (1,cv,0); + draw p scaled c; +endfor; +endfig; +end; |