Debian Codegraph @

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

raw
1 % intersectprolatespheroid.mp
2 % L. Nobre G.
3 % 2013
4
5 input featpost3Dplus2D;
6
7 beginfig(1);
8 numeric ray, i, Num, zcoord;
9 color startpoi, lindir, outpoi, auxpoi;
10 ray = 0.6;
11 zcoord = 0.75;
12 startpoi = (1.5,1.5,zcoord);
13 lindir = (4,3,0);
14 Num = 12;
15 spheroid( black, blue, ray );
16 drawoptions( dashed (withdots scaled 0.25) );
17 draw rigorouscircle( black, blue, ray );
18 draw rigorouscircle( (0,0,zcoord), blue, ray*(1 +-+ zcoord) );
19 drawoptions();
20 for i=0 upto Num:
21 auxpoi := startpoi+red*i/Num;
22 outpoi := intersectprolatespheroid( black, blue, ray, auxpoi, lindir );
23 draw rp(auxpoi)--rp(outpoi) withpen pencircle scaled 1pt;
24 endfor;
25 endfig;
26
27 end.