summaryrefslogtreecommitdiff
path: root/info/examples/lgc2/4-1-15.mp
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /info/examples/lgc2/4-1-15.mp
Initial commit
Diffstat (limited to 'info/examples/lgc2/4-1-15.mp')
-rw-r--r--info/examples/lgc2/4-1-15.mp24
1 files changed, 24 insertions, 0 deletions
diff --git a/info/examples/lgc2/4-1-15.mp b/info/examples/lgc2/4-1-15.mp
new file mode 100644
index 0000000000..7e42d93cb4
--- /dev/null
+++ b/info/examples/lgc2/4-1-15.mp
@@ -0,0 +1,24 @@
+% --- start of displayed preamble in the book ---
+vardef star(expr n) =
+ for i_:=0 upto 2n-1:
+ if odd i_: 1/2 fi (right rotated (180*(i_/n))) --
+ endfor cycle
+enddef;
+
+vardef blur(expr p,w,col)=
+ for i:=10 downto 1:
+ pickup pencircle scaled ((i*i/100)*w);
+ draw p withcolor ((i/10)[col,white]);
+ endfor;
+enddef;
+
+% --- end of displayed preamble in the book ---
+defaultfont:="ptmr8r";
+warningcheck:=0;
+beginfig(1)
+blur (unitsquare scaled 3cm,.5mm,red);
+blur (fullcircle scaled 4cm,1mm,blue);
+blur (star(10) xscaled 30mm yscaled 20mm
+ rotated 20,2mm,black);
+endfig;
+end;