summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/metapost/featpost/example/raiodoscirculos.mp
blob: 27974ecb0e8bc7325aedf2ad08fff5ba448a7e66 (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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
% raiodoscirculos.mp
% L. Nobre G.
% 2014

beginfig(1);
  numeric u, r, p;
  u = 2cm;
  r = 2/(3+sqrt(7));
  p = u/40;
  pen mypen;
  mypen = pencircle scaled p;
  drawoptions( withpen mypen );
  path mysquare, halcir, fulcir;
  mysquare = origin--right--(right+up)--up--cycle;
  halcir = halfcircle scaled 2r shifted (r*right);
  fulcir = fullcircle scaled 2r shifted ((1-r)*(right+up));
  draw mysquare scaled u;
  draw halcir scaled u;
  draw fulcir scaled u;
endfig;

beginfig(2);
  drawoptions( withpen mypen );
  draw mysquare scaled u;
  r := (sqrt(5)-1)/2;
  halcir := halfcircle shifted (right/2);
  draw halcir scaled u;
  path quarcirc;
  quarcirc = (halfcircle cutafter (origin--up)) rotated 180;
  draw quarcirc scaled 2r shifted (right+up) scaled u;
endfig;

beginfig(3);
  drawoptions( withpen mypen );
  draw mysquare scaled u;
  draw halcir scaled u;
  r := 2-sqrt(3);
  draw fullcircle scaled 2r shifted ((1-r)*(right+up)) scaled u;
endfig;

beginfig(4);
  drawoptions( withpen mypen );
  draw mysquare scaled u;
  draw halcir scaled u;
  r := 1/3;
  path secondhalfcircle;
  secondhalfcircle = halfcircle scaled 2r rotated 90 shifted (1,1-r);
  draw secondhalfcircle scaled u;
endfig;

beginfig(5);
  drawoptions( withpen mypen );
  draw mysquare scaled u;
  r := sqrt(2)-1;
  draw quarcirc scaled 2 shifted (right+up) scaled u;
  draw quarcirc rotated 180 scaled (2r*u);
endfig;

beginfig(6);
  drawoptions( withpen mypen );
  draw mysquare scaled u;
  r := 1/4;
  halcir := halfcircle scaled 0.5 shifted (r*right);
  draw halcir scaled u;
  draw quarcirc scaled 2 shifted (right+up) scaled u;
endfig;

beginfig(7);
  drawoptions( withpen mypen );
  path thisquare;
  thisquare = mysquare scaled u;
  draw thisquare;
  r := (sqrt(7)-1)/3;
  halcir := (halfcircle scaled 2r shifted (r*right)) cutbefore mysquare;
  draw halcir scaled u;
  draw quarcirc scaled 2r shifted (right+up) scaled u;
endfig;

beginfig(8);
  drawoptions( withpen mypen );
  draw mysquare scaled u;
  r := 1/(1+sqrt(2));
  draw quarcirc rotated 180 scaled (2r*u);
  draw fullcircle scaled 2r shifted ((1-r)*(right+up)) scaled u;
endfig;

beginfig(9);
  drawoptions( withpen mypen );
  draw mysquare scaled u;
  r := 1/(1+sqrt(2));
  halcir := halfcircle scaled 2r shifted (r*right);
  draw halcir scaled u;
  secondhalfcircle := halfcircle scaled 2r rotated 90 shifted (1,1-r);
  draw secondhalfcircle scaled u;
endfig;

end.