prologues := 3;
outputtemplate := "%j/%j-%c.svg";
outputformat := "svg";
verbatimtex
%&latex
\documentclass{minimal}
\usepackage[charter]{mathdesign}
\begin{document}
etex
% unitee
u:=0.7cm;
%% Macro JMS -----------------------------------------------------------------
picture UnBeauPoint;
UnBeauPoint := image(
fill fullcircle scaled 3pt;
fill fullcircle scaled 2pt withcolor white;
);
vardef pointe expr p = draw UnBeauPoint shifted p; enddef;
%%----------------------------------------------------------------------------
%parametre(s)
a:=3u;
b:=4u;
%les points fixes
pair A,B,O;
O:=(0,0);
A:=(a,0);
B:=(a+b,0);
%les points mobiles
pair C,P,D,M,N;
%le chemin du cadre de l'animation
pair cadre[];
cadre[0]:=(-4u,-8u);
cadre[1]:=(10u,-8u);
cadre[2]:=(10u,8u);
cadre[3]:=(-4u,8u);
%les chemins necessaires
path verticale, conchoideG, conchoideD,rayon;
verticale:=(a,2.8*ypart(cadre[1]))--(a,2.8*ypart(cadre[3]));
j:=0;
for i:=80 step (-0.5) until -80:
beginfig(j);
%les axes
drawarrow (xpart(cadre[0]),0)--(xpart(cadre[1]),0);
drawarrow (0,ypart(cadre[1]))--(0,ypart(cadre[3]));
draw verticale dashed evenly;
%le rayon
% % un point du cercle unite
C:=(cosd(i),sind(i))*u;
D:=25[O,C]; %le point D assez loin :-)
%on dessine le rayon
rayon:=O--D;
draw rayon dashed evenly;
%on determine P
P:=verticale intersectionpoint rayon;
%les points de la courbe
% % on recupere la longueur OP
long:=arclength(O--P);
show long;
show b;
show b/long;
M:= (1-b/long)[O,P];
N:= (1+b/long)[O,P];
%les courbes
if i=80:
conchoideG:=M;
conchoideD:=N;
else:
conchoideG:=conchoideG--M;
conchoideD:=conchoideD--N;
fi;
%on dessine
draw (P--M) withcolor blue withpen pencircle scaled 1pt ;
draw (P--N) withcolor blue withpen pencircle scaled 1pt ;
draw conchoideG withcolor red withpen pencircle scaled 1pt;
draw conchoideD withcolor red withpen pencircle scaled 1pt;
%on dessine les points fixes
label.lrt(btex $A$ etex,A);
label.lrt(btex $O$ etex,O);
label.lrt(btex $B$ etex,B);
pointe(B);
pointe(A);
pointe(O);
%on dessine les points courant
label.urt(btex $P$ etex, P);
label.urt(btex $M$ etex, M);
label.urt(btex $N$ etex, N);
pointe(P);
pointe(M);
pointe(N);
%titre legende
label(btex $\rho=\frac{a}{\cos \theta}\pm b$ etex, (8u,6u));
%on clip
clip currentpicture to cadre[0]--cadre[1]--cadre[2]--cadre[3]--cycle;
endfig;
j:=j+1;
endfor;
end.