summaryrefslogtreecommitdiff
path: root/info/examples/lgc2/4-1-15.mp
blob: 7e42d93cb4b9dffd2c9703d1e55e494c291fe99c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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;