prologues := 3;
outputtemplate := "%j/%j-%c.svg";
outputformat := "svg";
verbatimtex
%&latex
\documentclass{article}
\usepackage{amsmath}
\usepackage[charter]{mathdesign}
\begin{document}
etex
path carre;
carre = (0,0)--(1,0)--(1,1)--(0,1)--cycle;
vardef proj(expr P,M,N) =
save H; pair H;
H = whatever [M,N];
H - P = whatever * (M - N) rotated 90;
H
enddef;
path courbe;
u:=2cm;
for i:=-45 upto 225:
beginfig(i+45);
path bcercle, pcercle,bissA;
pair A,P,O,M,O';
% repere
drawarrow (-4u,0)--(4u,0) withpen pencircle scaled 0.6pt;;
drawarrow (0,-4u)--(0,4u) withpen pencircle scaled 0.6pt;;
% le cercle constructeur
bcercle:=fullcircle scaled 6u;
draw bcercle withcolor blue withpen pencircle scaled 0.8pt;
O:=(0,0);
A:=(3u,0);
% le point décrivant le cercle constructeur
P:= 3u*(cosd(i*2),sind(i*2));
% Après calcul, on obtient les coordonnées du centre du cercle inscrit
O':=3u*((cosd(i)*cosd(i))/(sind(i)+1),sind(i)*cosd(i)/(sind(i)+1));
% le point décrivant la courbe
M:=proj(O',O,P);
if i=-45:
courbe := M;
else:
courbe := courbe--M;
fi;
% le cercle inscrit
g := 2*abs(O'-M);
fill fullcircle scaled g shifted O'
% withpen pencircle scaled 0.8pt
withcolor 2*(0.4,0.8,0.2);
% le triangle
draw A--P--O--cycle withcolor green withpen pencircle scaled 0.8pt;
% les bissectrices
draw 12[A,O']--12[O',A] dashed evenly
withpen pencircle scaled 0.8pt withcolor 0.7 white;
draw 12[O,O']--12[O',O] dashed evenly
withpen pencircle scaled 0.8pt withcolor 0.7 white;
% M
draw O'--M dashed evenly withcolor green
withpen pencircle scaled 0.8pt;
% la courbe
draw courbe withcolor red withpen pencircle scaled 1.2pt;
% légende
dotlabel.urt(btex \begin{Large} $A$ \end{Large} etex, A);
dotlabel.urt(btex \begin{Large}$P$ \end{Large} etex, P);
dotlabel.lrt(btex \begin{Large} $O'$ \end{Large} etex, O');
dotlabel.urt(btex \begin{Large}$M$ \end{Large} etex, M);
dotlabel.llft(btex \begin{Large} $O$ \end{Large} etex, O);
label.bot(btex \begin{Large} $x$ \end{Large} etex, (3.7u,0));
label.lft(btex \begin{Large} $y$ \end{Large} etex, (0,3.7u));
label.urt(btex
\begin{Large} $\rho=1-\sin \frac{t}{2}$ \end{Large}
etex, (1.8u,2.8u));
clip currentpicture to
(-4u,-4u)--(-4u,4u)--(4u,4u)--(4u,-4u)--cycle;
endfig;
endfor;
end.