Debian Codegraph @

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

raw
1 % nemquirapitch.mp
2 % L. Nobre G.
3 % 2002
4
5 input featpost3Dplus2D;
6
7 verbatimtex
8 \documentclass{article}
9 \usepackage{beton}
10 \usepackage{concmath}
11 \usepackage{ccfonts}
12 \begin{document}
13 etex
14
15 beginfig(1);
16 f := 7*(1,2,1);
17 Spread := 70;
18 ahlength := 3mm;
19 ahangle := 48;
20
21 numeric hsdev, basestep, basemax, basesdev, xpos;
22 numeric i, j, angsdev, cylength, cyradius, basen;
23 numeric vcx, vcy, vcz, hcurr, xcurr, ycurr, aone;
24 numeric atwo, zcurr, angstep, counter, linelen;
25 color lenvec, currpos;
26
27 angstep := 20;
28 cylength := 0.45;
29 cyradius := 0.1;
30 basen := 4.5;
31 basestep := cylength*1.37;
32 basesdev := basestep*0.05;
33 hsdev := basesdev;
34 angsdev := 4;
35 linelen := cylength;
36
37 basemax := basen*basestep;
38 xpos := -(basen+1)*basestep;
39 draw rp((-xpos-0.5*cylength,-basemax,0))--rp((-xpos+0.5*cylength,-basemax,0));
40 draw rp((-xpos-0.5*cylength,basemax,0))--rp((-xpos+0.5*cylength,basemax,0));
41 drawdblarrow rp((-xpos,-basemax,0))--rp((-xpos,basemax,0));
42 label.urt( btex $\frac{p}{2}$ etex scaled 2.5, rp((-xpos,0,0)) );
43 counter := 0;
44 for i=-basen upto basen:
45 for j=-basen upto basen:
46 zcurr := hsdev*normaldeviate;
47 xcurr := i*basestep + basesdev*normaldeviate;
48 ycurr := j*basestep + basesdev*normaldeviate;
49 aone := angsdev*normaldeviate;
50 atwo := j*angstep + angsdev*normaldeviate;
51 vcz := sind( atwo+90 );
52 vcy := cosd( atwo+90 )*sind( aone );
53 vcx := cosd( atwo+90 )*cosd( aone );
54 currpos := ( xcurr, ycurr, zcurr );
55 lenvec := cylength*( vcx, vcy, vcz );
56 % rigorousdisc( 0, true, currpos-0.5*lenvec, cyradius, lenvec);
57 counter := incr(counter);
58 generatedirline( counter, aone, 90+atwo, cylength, currpos );
59 endfor;
60 endfor;
61 NL := counter;
62 director_invisible( true, 5, false );
63 endfig;
64
65 verbatimtex
66 \end{document}
67 etex
68
69 end;