Debian Codegraph @

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

raw
1 % simplexperiment.mp
2 % L. Nobre G.
3 % 2007
4
5 input featpost3Dplus2D;
6
7 verbatimtex
8 \documentclass{article}
9 \usepackage{palatino}
10 \usepackage{mathpazo}
11 \begin{document}
12 etex
13
14 beginfig(1);
15 Spread := 45;
16 numeric barh, barl, bart, bardist, bardept, sphr, numlats, i, ie, is;
17 numeric cicon, alpha, fhd, conr, conh, linel;
18 color centerb, linpa, linpb, linpc;
19 path tmp, lina, cicloi;
20 pen thin, thick, aver;
21 sphr = 1;
22 conr = 0.3;
23 barh = 1;
24 barl = 7;
25 bart = 0.2;
26 numlats = 2;
27 linel = 5;
28 ie = 630;
29 is = 5;
30 alpha = 40;
31 fhd = 9;
32 f := 3*(fhd*cosd(alpha)-sphr*sind(alpha),fhd*sind(alpha)+sphr*cosd(alpha),2);
33 bardist = sphr*sind(90/numlats);
34 bardept = sphr*cosd(90/numlats);
35 conh = barh+bardept-sphr;
36 cicon = bardept*3.14159/180.0;
37 thin = pencircle scaled 0.5pt;
38 thick= pencircle scaled 1.5pt;
39 aver = pencircle scaled 1.0pt;
40 ahlength:=2mm;
41 ahangle:=30;
42 % kindofcube( WithDash, IsVertex, RefP, AngA, AngB, AngC, LenA, LenB, LenC )
43 kindofcube(false,true,(-bardist-bart,0,-bardept),0,0,180,bart,barl,barh );
44 % tropicalglobe( expr NumLats, TheCenter, Radius, AngulMom );
45 tropicalglobe( numlats, black, sphr, red );
46 cicloi = rp((0,0,sphr)) for i=is step is until ie:
47 ..rp((0,-sphr*sind(i)-cicon*i,sphr*cosd(i))) endfor;
48 draw cicloi;
49 kindofcube( false, true, (bardist,0,-bardept), 0,0,180, bart, barl, barh );
50 centerb = 2*sphr*(-sind(alpha),cosd(alpha),0);
51 linpb = -blue*(bardept+barh);
52 linpa = linpb+green*linel;
53 linpc = linpb+linel*(green*cosd(alpha)-red*sind(alpha));
54 draw rp(linpa)--rp(linpb)--rp(linpc);
55 angline( linpa, linpc, linpb, 0.7*linel, btex $\alpha$ etex scaled 3)(rt);
56 verygoodcone(false,centerb-(sphr+conh)*blue,blue,conr,centerb-sphr*blue);
57 tmp = rigorousfearpath( centerb, sphr );
58 unfill tmp;
59 draw tmp;
60 drawoptions( dashed evenly );
61 draw goodcirclepath( black, blue, sphr );
62 draw goodcirclepath( centerb, blue, sphr );
63
64
65
66 endfig;
67
68 verbatimtex
69 \end{document}
70 etex
71
72 end;