Debian Codegraph @

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

raw
1 % elliptictable.mp
2 % L. Nobre G.
3 % 2006
4
5 verbatimtex \documentclass{article} \begin{document} etex
6
7 beginfig(1);
8 numeric u, l, mar, h, i, s, ai, bi, ao, bo, d;
9 u = 0.85mm;
10 l = 125u;
11 d = 0.5l;
12 mar = 12.0u;
13 h = 70u;
14 s = 5;
15 z1 = (l-2mar,0);
16 z2 = (l-mar,0);
17 z3 = (l,0);
18 z5 = (l-2mar,d-mar);
19 z6 = (l-2mar,d);
20 z7 = (l-mar,d);
21 z8 = (l,d);
22 z10= (l-2mar-h,d-mar);
23 z11= (l-2mar-h,d);
24 z12= (0,d);
25 z13= (0,d-mar);
26 ai = l-2mar;
27 bi = (d-mar)/(1+-+((l-2mar-h)/ai));
28 z14= (ai+-+bi,0);
29 ao = l-mar;
30 bo = d/(1+-+((l-2mar-h)/ao));
31 z15= (ao+-+bo,0);
32 path ellin, elout, cutpe, cutpb, bordo;
33 ellin = z1 for i=s step s until 90: ..(ai*cosd(i),bi*sind(i)) endfor;
34 elout = z2 for i=s step s until 90: ..(ao*cosd(i),bo*sind(i)) endfor;
35 cutpe = (1.1[z11,z10])--(1.1[z10,z11]);
36 cutpb = z1--z6;
37 bordo = elout cutafter cutpe cutbefore cutpb;
38 z4 = point 0 of bordo;
39 z9 = bordo intersectionpoint (z5--z13);
40 draw z3--z8--z6--z4;
41 draw z5--z9;
42 draw z2--z7;
43 draw ellin--z12--z11--(reverse bordo)--z1;
44 draw z6--z11--z10;
45 draw currentpicture xscaled -1;
46 pen pendot;
47 pendot = pencircle scaled 2u;
48 z22= (l,d-mar*ai/bi);
49 z23= (l-2mar,d-mar*ai/bi);
50 % draw z22{up}..z7{left}..{down}z23;
51 z24= z7+down*mar;
52 draw z22--z24--z23;
53 drawoptions( dashed evenly );
54 z17 = (ai,bi)*sqrt(2.0)*0.5;
55 z18 = z17 - h*unitvector((bi,ai));
56 draw z17--z18;
57 z19 = (0,-y18-x18*bi/ai);
58 z20 = z19+whatever*(ai,-bi);
59 z20 = z17-whatever*(bi,ai);
60 z21 = z20-l*unitvector((ai,-bi));
61 draw z20--z21;
62 drawoptions();
63 draw z14 withpen pendot;
64 draw z15 withpen pendot;
65 draw z17 withpen pendot;
66 % dotlabels.bot( 17, 18, 20, 21 );
67 picture tmppic;
68 tmppic = currentpicture;
69 currentpicture := nullpicture;
70 z16= (105mm,145mm);
71 draw tmppic rotated 90 shifted z16;
72 draw tmppic rotated -90 shifted z16;
73 label.rt( decimal((x14)/u), z14 rotated 90 shifted z16 );
74 label.lft( decimal((x15)/u), z15 rotated 90 shifted z16 );
75 label.rt( decimal((x17)/u), z17 rotated 90 shifted z16 );
76 tmppic := currentpicture;
77 currentpicture := nullpicture;
78 draw tmppic shifted (-z16) rotated (-90) shifted z16;
79 endfig;
80
81 verbatimtex \end{document} etex
82
83 end;