Épicycloïde
%@AUTEUR: Maxime Chupin
%@DATE: 28 mars 2007
verbatimtex
%&latex
\documentclass{article}
\usepackage{amsmath}
\begin{document}
etex
u:=1cm;
a:=3u;
m:=3;
q:=5/m;
pair O,O',M;
O:=(0,0);
path gcercle,pcercle,rayon,epi;
for i:=0 upto (m*180):
beginfig(i+1);
pickup pencircle scaled 0.8pt;
drawarrow (-1.2*a-(2*a/q),0)--(1.2*a+(2*a/q),0);
drawarrow (0,-1.2*a-(2*a/q))--(0,1.2*a+(2*a/q));
gcercle:=fullcircle scaled (2*a);
O':=((a+(a/q))*cosd(i*2),(a+(a/q))*sind(i*2));
pcercle := fullcircle scaled ((2*a)/q) shifted O';
rayon:= (0,0)--(12*u*cosd((q+1)*i*2),12*u*sind((q+1)*i*2));
rayon := rayon shifted O';
M := rayon intersectionpoint pcercle;
if i=0:
epi := M;
else:
epi := epi--M;
fi;
pickup pencircle scaled 0.7pt;
draw gcercle dashed evenly withcolor blue;
draw pcercle dashed evenly withcolor green;
draw O'--M dashed evenly;
pickup pencircle scaled 1pt;
draw epi withcolor red;
label.top(btex $a$ etex , (a/2,0));
label.urt(btex $\frac{a}{q}$ etex,
((xpart O'+xpart M)/2,(ypart O'+ypart M)/2));
dotlabel.urt(btex $M$ etex, M);
dotlabel.urt(btex $O'$ etex, O');
dotlabel.urt(btex $O$ etex, O);
clip currentpicture to (-1.2*a-(2*a/q),-1.2*a-(2*a/q))
--(1.2*a+(2*a/q),-1.2*a-(2*a/q))
--(1.2*a+(2*a/q),1.2*a+(2*a/q))
--(-1.2*a-(2*a/q),1.2*a+(2*a/q))--cycle;
endfig;
endfor;
end