Debian Codegraph @

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

raw
1 % naotocanacalote.mp
2 % L. Nobre G.
3 % 2012
4
5 verbatimtex \documentclass{article}\begin{document} etex
6
7 beginfig(1);
8 numeric N, h, R, m, i, l, d, X, angl;
9 N = 2;
10 R = 13mm;
11 h = N*R;
12 m = 8;
13 l = 2R;
14 d = 4mm;
15 angl = 50;
16 path calotes, queda;
17 if N=1:
18 calotes = (0,h)... for i=1 upto m-1:
19 (R*(sind(i*90/m),cosd(i*90/m)))...
20 endfor {down}(R,0);
21 X = sqrt(2)*R;
22 queda = (-R,h+d)---(0,h+d){right}...{unitvector(1,-sqrt(2))}(X,d);
23 elseif N=2:
24 calotes = (0,h)... for i=1 upto 2*m-1:
25 (R*(sind(i*90/m),1+cosd(i*90/m)))...
26 endfor {left}origin;
27 X = 2R;
28 queda = (-R,h+d)---(0,h+d){right}...{unitvector(1,-2)}(X,d);
29 else:
30 calotes = (0,h)... for i=1 upto 2*m-1:
31 (R*(sind(i*90/m),2+cosd(i*90/m)))...
32 endfor for i=1 upto m-1:
33 (R*(sind(-i*90/m),cosd(i*90/m)))...
34 endfor {down}(-R,0);
35 X = sqrt(6)*R;
36 queda = (-R,h+d)---(0,h+d){right}...{unitvector(1,-sqrt(6))}(X,d);
37 fi;
38 drawoptions( withpen pencircle scaled (0.75mm) );
39 draw (-l,h)--calotes;
40 draw (-R,0)--(X+R,0);
41 drawoptions();
42 draw fullcircle scaled (2d) shifted (0,h+d);
43 draw fullcircle scaled (2d) shifted (X,d);
44 drawarrow (0,h+d)--(R,h+d);
45 label.top( btex $\vec{v}_{\mathrm{min}}$ etex, (0.6R,h+d) );
46 drawdblarrow origin--(0,h);
47 label.lft( btex $h$ etex, (0,h-0.5R) );
48 drawdblarrow (0,d)--(X,d);
49 label.top( btex $x$ etex, (0.5X,d) );
50 drawarrow (0,h-R)--(R*cosd(angl),h+R*(sind(angl)-1));
51 label.ulft( btex $R$ etex, (0.5*R*cosd(angl),h-R+0.5*R*sind(angl)) );
52 drawoptions( dashed evenly );
53 draw queda;
54 endfig;
55
56 verbatimtex \end{document} etex
57
58 end.