Debian Codegraph @

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

raw
1 % geomsrinath.mp
2 % L. Nobre G.
3 % 2013
4
5 input featpost3Dplus2D;
6
7 verbatimtex
8 \documentclass{article}
9 \usepackage{palatino,mathpazo}
10 \begin{document}
11 etex
12
13 beginfig(1);
14 f := 3*(1.7,1.2,0.8);
15 Spread := 125;
16 numeric thetan, phiang, faca, phiray, cray, mar;
17 color origr, nothr, mfxxp, mfxyp, mfyyp, mfzzp, vmagf, mfxyext, ac, bc;
18 thetan = 55;
19 phiang = 65;
20 faca = 1.15;
21 phiray = 0.485;
22 cray = 0.067;
23 origr = (0,0,0);
24 mar = 0.15;
25 vmagf = faca*(cosd(phiang)*cosd(thetan),sind(phiang)*cosd(thetan),sind(thetan));
26 nothr = (0,0,1);
27 bc = (faca-2*mar)*N(vmagf);
28 ac = mar*N(vmagf);
29 mfxxp = (X(vmagf),0,0);
30 mfxyp = (X(vmagf),Y(vmagf),0);
31 mfyyp = (0,Y(vmagf),0);
32 mfzzp = (0,0,Z(vmagf));
33 cartaxes( 0.8, 0.8, 1 );
34 rigorousdisc(0,true,ac,cray,bc);
35 draw rp(origr)--rp(mfxyp)--rp(vmagf)--rp(mfzzp) dashed evenly;
36 draw rp(mfxxp)--rp(mfxyp)--rp(mfyyp) dashed evenly;
37 if conorm(mfxyp)<phiray:
38 mfxyext = phiray*N(mfxyp);
39 draw rp(mfxyext)--rp(mfxyp) dashed evenly;
40 fi;
41 angline(mfxxp,mfxyp,origr,phiray,btex $\phi$ etex,bot);
42 angline(vmagf,nothr,origr,0.5,btex $\theta$ etex,top);
43 pickup pencircle scaled 1.15pt;
44 drawarrow rp(origr)..rp(vmagf);
45 label.rt(btex $\vec{n}$ etex,rp(nothr));
46 label.rt(btex $\hat{a}$ etex,rp(vmagf));
47 pickup pencircle scaled 2.6pt;
48 draw rp(ac);
49 draw rp(ac+bc);
50 endfig;
51
52 verbatimtex
53 \end{document}
54 etex
55
56 end;
57