Debian Codegraph @

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

raw
1 % signalvertexSD.mp
2 % L. Nobre G.
3 % 2003
4
5 input featpost3Dplus2D;
6
7 % Draw a torus with NP dots, a section of 3.14*RS^2
8 % and a total diameter of 2*(RB+RS). The dots are placed
9 % on a single closed line that turns around the $z$ axis
10 % NB times and around the section NS times.
11
12 f := 0.45f;
13
14 %SphericalDistortion := true; Spread := 11;
15
16 beginfig(1);
17 NP:=2000;
18 RB:=1;
19 RS:=0.2;
20 R3:=0.0;
21 NB:=8;
22 NS:=5;
23 jB:=360*NB/NP;
24 jS:=360*NS/NP;
25 for i=1 upto NP:
26 phi :=i*jS;
27 theta :=i*jB;
28 first :=(RB+(RS+R3*sind(4*theta))*cosd(phi))*cosd(theta);
29 second:=(RB+(RS+R3*sind(4*theta))*cosd(phi))*sind(theta);
30 third := (RS+R3*sind(4*theta))*sind(phi);
31 signalvertex( (first,second,third), 1, black );
32 endfor;
33 endfig;
34
35 end;
36
37
38
39
40