summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/metapost/featpost/example/quartertorus.mp
blob: 0d2ca4da09886d7ceb08d8831bf463aeca5f5f72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
% quartertorus.mp
% L. Nobre G.
% 2012

input featpost3Dplus2D;

prologues := 3;

verbatimtex
\documentclass{article} 
\usepackage{mathpazo} 
\begin{document} 
etex

f := (3,5,2.5);

beginfig(1);
  color a, b, c, g, h, i, j, l, m, n;
  numeric fac, siz, s;
  fac = 0.05;
  siz = 0.3;
  s = 2;
  a = blue-red;
  b = g-fac*a;
  c = -a-fac*g;
  g = -green;
  h = 2*g;
  i = red+g;
  j= -red;
  l = blue;
  m = 0.6red-g;
  n = -0.7*blue;
  drawoptions( withpen pencircle scaled 2.5pt );
  quartertorus( black, h, i, siz );
  quartertorus( black, g, a, siz );
  quartertorus( black, b, c, siz );
  quartertorus( black, -g, j, siz );
  quartertorus( n, l, m, siz );
  label( btex $a$ etex scaled s, rp( a ) );
  label.llft( btex $b$ etex scaled s, rp( b ) );
  label( btex $c$ etex scaled s, rp( c ) );
  label.urt( btex $g$ etex scaled s, rp( g ) );
  label( btex $-g$ etex scaled s, rp( -g ) );
  label( btex $h$ etex scaled s, rp( h ) );
  %label( btex $i$ etex scaled s, rp( i ) );
  label( btex $j$ etex scaled s, rp( j ) );
  label( btex $l$ etex scaled s, rp( l+n ) );
  label( btex $m$ etex scaled s, rp( m+n ) );
endfig;

beginfig(2);
  color col[];
  numeric ray, ang, len, bigray;
  ray = 0.15;
  bigray = 0.4;
  ang = 60;
  len = 0.7;
  col1 = (-(ray+bigray)/cosd(ang),0,0);
  col2 = (bigray*cosd(ang),0,bigray*sind(ang));
  col3 = (bigray*cosd(ang),0,-bigray*sind(ang));
  col4 = ((ray+bigray)*cosd(ang),0,(ray+bigray)*sind(ang));
  col5 = ((ray+bigray)*cosd(ang),0,-(ray+bigray)*sind(ang));
  col6 = (-len*sind(ang),0,len*cosd(ang));
  col7 = (-len*sind(ang),0,-len*cosd(ang));
  col8 = col1+col4+col6;
  col9 = col1+col5+col7;
  rigorousdisc( 0, true, col1+col3, ray, col7 );
  rigorousdisc( 0, true, col1+col2, ray, col6 );
  quartertorus( col1, col3, col2, ray );
  draw rp(col9)--rp(black)--rp(col8);
endfig;

verbatimtex 
\end{document} 
etex

end.