%@ Maxime Chupin
%@ 14 janvier 2017
prologues := 3;
outputtemplate := "%j/%j-%c.svg";
outputformat := "svg";
verbatimtex
%&latex
\documentclass{article}
\usepackage{amsmath}
\usepackage[charter]{mathdesign}
\begin{document}
etex
% unité
u:=1.5cm;
%rayon cercle
r:=1.5u;
% marge pour le clip
marge := 0.4u;
% le cercle
path cercle;
cercle := fullcircle scaled 2r;
% les points
pair C,B,D,M,P;
C := (3u, 0);
B := (-r,0);
% fonction qui retourne une droite à partir de deux points
vardef droite(expr A,B) =
save d;
path d;
d := 20[A,B]--20[B,A];
d
enddef;
% droite parallele à (A,B) passant par C
vardef parallele(expr A, B, C) =
save dir,D,droite;
path droite;
pair dir,D;
dir := B-A;
D := C+dir;
droite := 10[C,D]--10[D,C];
droite
enddef;
% la droite parallèle à (C,P)
path para;
% perpendiculaire à (Ox) passant par D
path perp;
% la droite (CP)
path CP;
% l'axe Ox
path Ox;
Ox := droite (C,(-r,0));
% path du clip
path clipPath;
clipPath := (-r-marge, -r-marge)--(xpart C+marge,-r-marge)--(xpart C+marge,r+marge)--(-r-marge,r+marge)--cycle;
% la courbe
path rosillo;
% la boucle pour faire les images de l'animation
for i:=0 upto 359:
beginfig(i);
% construtsion des differents points
P := r*(cosd(i),sind(i));
CP := droite(C,P);
D := (xpart P,0);
para := parallele(C,P,B);
perp := droite(D,P);
M := para intersectionpoint perp;
if(i=0):
rosillo := M;
else:
rosillo := rosillo -- M;
fi;
draw cercle dashed evenly withcolor (0.1,0.7,0.1);
draw CP dashed evenly;
draw Ox dashed evenly;
draw perp dashed evenly;
draw para dashed evenly;
draw C--P withcolor (0.1,0.1,0.7);
draw B--M withcolor (0.1,0.1,0.7);
draw D--P withcolor (0.1,0.1,0.7);
draw D--M withcolor (0.1,0.1,0.7);
% la courbe
draw rosillo withpen pencircle scaled 1pt withcolor (0.7,0.1,0.1);
% les labels
dotlabel.lrt(btex $C$ etex, C);
dotlabel.llft(btex $B$ etex, B);
dotlabel.bot(btex $P$ etex, P);
dotlabel.lrt(btex $D$ etex, D);
dotlabel.bot(btex $M$ etex, M);
label.urt(btex $\mathcal C$ etex, r*(cosd(50),sind(50)));
label.ulft(btex \itshape La courbe de Rosillo etex, (xpart C+0.5marge,-r-0.5marge));
% le clip
draw clipPath withcolor white;
clip currentpicture to clipPath;
endfig;
endfor;
end.