Debian Codegraph @

texmf-dist/doc/metapost/featpost/example/beautiful00.mp

raw
1 % beautiful00.mp
2 % L. Nobre G.
3 % 2014
4
5 prologues := 1;
6
7 beginfig(1);
8 numeric u, firstep, cylray, plangle, i, a, as, speed, dist, accel, li, aux;
9 pair poi, tip, ref;
10 pen one;
11 accel = 0.27;
12 u = 1.2cm;
13 firstep = 6u;
14 cylray = 2u;
15 plangle = 12;
16 as = 5;
17 ahangle := 30;
18 ahlength := 0.035cylray;
19 one = pencircle scaled 0.015cylray;
20 drawoptions( withpen one );
21 li = 3;
22 aux = li*accel*firstep*(li+1);
23 fill (-cylray,0)--(aux,0)--(aux,-ahlength)--(-cylray,-ahlength)--cycle withcolor 0.5white;
24 for i=0 upto li:
25 speed := i*accel;
26 ref := (speed*firstep*i,0);
27 for a=as-90 step as until 270-as:
28 poi := ref+cylray*(dir(a)+up);
29 dist := abs( poi-ref );
30 tip := poi+speed*dist*dir(0.5*a-45);
31 drawarrow poi--tip;
32 endfor;
33 endfor;
34 picture tmpicture;
35 tmpicture = currentpicture;
36 currentpicture := nullpicture;
37 draw tmpicture rotated -plangle;
38 endfig;
39
40 end.