Debian Codegraph @

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

raw
1 % rotatnlc.mp
2 % L. Nobre G.
3 % 2003
4
5 input featpost3Dplus2D;
6
7 beginfig(1);
8
9 f := 2*(2,1,0.55);
10
11 Spread := 450;
12
13 color gridvec, sizevec, currpos, starpos, bordpos;
14 numeric i, j, k, counter, theta, phi, thetamin;
15 numeric thetamax, thetastp, long, radius, polar;
16 sizevec := (7,42,1); % (number of circles,
17 % number of vectors in outer circle,
18 % number of levels )
19 gridvec := (0.08,0.23,0.3);
20 thetamin := 90;
21 thetamax := 150;
22 long := 0.08;
23 thetastp := (thetamax-thetamin)/(X(sizevec)-1);
24 starpos := ( -X(gridvec)*X(sizevec) ,
25 -X(gridvec)*X(sizevec) ,
26 0 );
27 bordpos := starpos;
28 counter := 1;
29 for i=1 upto X(sizevec):
30 radius := (i-1)*X(gridvec);
31 polar := i*floor(Y(sizevec)/X(sizevec));
32 for j=1 upto polar:
33 for k=1 upto Z(sizevec):
34 phi := 360*(j-1)/polar;
35 theta := thetamin+(i-1)*thetastp;
36 currpos := radius*(cosd(phi-90),sind(phi-90),0)
37 +(k-1)*(0,0,Z(gridvec));
38 generatedirline( counter, phi, theta, long, currpos );
39 counter := incr(counter);
40 endfor;
41 endfor;
42 endfor;
43 NL := decr(counter);
44 director_invisible( true, Y(gridvec), false );
45 endfig;
46
47 end;
48
49