File: beautiful00.mp

package info (click to toggle)
texlive-base 2020.20210202-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 791,092 kB
  • sloc: perl: 45,038; sh: 4,926; makefile: 4,655; ansic: 2,266; ruby: 2,231; tcl: 2,156; xml: 1,874; python: 822; cpp: 695; awk: 606; lisp: 199; sed: 8
file content (40 lines) | stat: -rw-r--r-- 915 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
% beautiful00.mp
% L. Nobre G.
% 2014

prologues := 1;

beginfig(1);
  numeric u, firstep, cylray, plangle, i, a, as, speed, dist, accel, li, aux;
  pair poi, tip, ref;
  pen one;
  accel = 0.27;
  u = 1.2cm;
  firstep = 6u;
  cylray = 2u;
  plangle = 12;
  as = 5;
  ahangle := 30;
  ahlength := 0.035cylray;
  one = pencircle scaled 0.015cylray;
  drawoptions( withpen one );
  li = 3;
  aux = li*accel*firstep*(li+1);
  fill (-cylray,0)--(aux,0)--(aux,-ahlength)--(-cylray,-ahlength)--cycle withcolor 0.5white;
  for i=0 upto li:
    speed := i*accel;
    ref := (speed*firstep*i,0);
    for a=as-90 step as until 270-as:
      poi := ref+cylray*(dir(a)+up);
      dist := abs( poi-ref );
      tip := poi+speed*dist*dir(0.5*a-45);
      drawarrow poi--tip;
    endfor;
  endfor;
  picture tmpicture;
  tmpicture = currentpicture;
  currentpicture := nullpicture;
  draw tmpicture rotated -plangle;
endfig;

end.