prologues := 3;
outputtemplate := "%j/%j-%c.svg";
outputformat := "svg";
verbatimtex
%&latex
\documentclass{article}
\usepackage{amsmath}
\usepackage[charter]{mathdesign}
\begin{document}
etex
u:=1cm;
pair O;
O:=(0,0);
path bicorne;
picture pol[];
for i:=0 upto 360:
beginfig(i);
drawarrow (-5u,0)--(5u,0);
drawarrow (0,-3u)--(0,7u);
pair P,M;
a:=2;
path cercle, cercleh, drPM, polaire,verti;
%on definit les deux cercles tangents disposes verticalement
cercle := fullcircle scaled (2*a*u);
cercleh := fullcircle scaled (2*a*u) shifted (0,(2*a*u));
%le point courant sur le cercle du haut
xP :=a*cosd(i);
yP :=a*sind(i)+2a;
P := u*(xP,yP);
%on definit la polaire p/r au cercle : xP.x+yP.y=a^2
polaire :=5[(-2u,-(-2)*u*xP/yP+a*a*u/yP),(2u,-(2)*u*xP/yP+a*a*u/yP)]--5[(2u,-(2)*u*xP/yP+a*a*u/yP),(-2u,-(-2)*u*xP/yP+a*a*u/yP)];
%la verticale passant par P
verti:=5[(0,2u),(0,-2u)]--5[(0,-2u),(0,2u)];
drPM:=verti shifted P;
%M comme intersection de la polaire et de la verticale passant par P
M:=drPM intersectionpoint polaire;
if i=0:
bicorne:=M;
else:
bicorne:=bicorne--M;
fi;
pol[i]:=image(
draw polaire withcolor 0.9 white;
);
draw cercle dashed evenly withcolor blue withpen pencircle scaled 0.8pt;
draw cercleh dashed evenly withcolor blue withpen pencircle scaled 0.8pt;
for j:=0 step 10 until i:
draw pol[j];
endfor;
draw polaire dashed evenly withcolor green withpen pencircle scaled 0.8pt;
draw drPM dashed evenly withcolor green withpen pencircle scaled 0.8pt;
draw bicorne withcolor red withpen pencircle scaled 1pt;
dotlabel.urt(btex $P$ etex,P);
dotlabel.llft(btex $M$ etex,M);
dotlabel.llft(btex $O$ etex,O);
label.llft(btex $x$ etex,(5u,0));
label.lrt(btex $y$ etex,(0,7u));
label.urt(btex $\mathcal{C}$ etex,u*a*(cosd(45),sind(45)));
label.ulft(btex $\mathcal{C}'$ etex,u*a*(cosd(135),sind(135)+2));
label.bot(btex $a$ etex,(a/2*u,0));
label.top(btex \textit{Le bicorne} etex, (-3u,6u));
label.top(btex $y^2(a^2-x^2)=(x^2+2ay-a^2)^2$ etex, (2.5u,6u));
clip currentpicture to (-5u,-3u)--(-5u,7u)--(5u,7u)--(5u,-3u)--cycle;
endfig;
endfor;
end.