summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/metapost/featpost/example/repeated/troncoconedef.mp
blob: 0429ac4533f42dab843c9bcc7e9295815ab399d0 (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
% troncoconedef.mp
% L. Nobre G.
% 2002

%input featpost3Dplus2D;

verbatimtex 
\documentclass{article} 
\usepackage{beton} 
\usepackage{concmath} 
\usepackage{ccfonts}
\begin{document} 
etex

f := (5,0,3);

def twoclicpathesinapen( expr CycleA, CycleB )=
    begingroup
	numeric TheLengthOfA, TheLengthOfB, TheMargin;
	path SubPathA, SubPathB;
	TheMargin = 0.02;
	TheLengthOfA = ( length CycleA ) - TheMargin;
 	TheLengthOfB = ( length CycleB ) - TheMargin;
	SubPathA = subpath ( 0, TheLengthOfA ) of CycleA;
	SubPathB = subpath ( 0, TheLengthOfB ) of CycleB;
	( makepath makepen ( SubPathA--SubPathB--cycle ) )
    endgroup
enddef;

beginfig(0);
	numeric rayo, rayt;
	path onec, twoc, botc;
	color axec, baso, bast;
	rayo = 1;
	rayt = 0.7;
	axec = red;
	baso = black;
	bast = (1,1,1);
	onec = goodcirclepath( baso, axec, rayo );
 	twoc = goodcirclepath( bast, axec, rayt ); 
 	botc = twoclicpathesinapen( onec, twoc );
	fill botc withcolor green;
	draw onec;
	draw twoc;
	draw botc;
	dotlabel.bot( btex onec0 etex, point 0 of onec ); 
	dotlabel.bot( btex twoc0 etex, point 0 of twoc ); 
endfig;

verbatimtex 
\end{document} 
etex

end.