prologues := 3;
outputtemplate := "%j/%j-%c.svg";
outputformat := "svg";
verbatimtex
%&latex
\documentclass{minimal}
\usepackage[charter]{mathdesign}
\begin{document}
etex
% unitee
u:=.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;
%les points fixes
pair A,B,O;
O:=(0,0);
A:=(a,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]));
picture fond[];
l:=0; %compteur fond
j:=0; %compteur image
for b:=.2u step 0.04u until 5u:
for k:=0 upto 1:
B:=(a+b,0);
if k=0:
beginfig(j);
else:
beginfig(240-j);
fi;
%les axes
drawarrow (xpart(cadre[0]),0)--(xpart(cadre[1]),0);
drawarrow (0,ypart(cadre[1]))--(0,ypart(cadre[3]));
draw verticale dashed evenly;
if l>0:
for m:=1 upto l:
draw fond[m];
endfor;
fi;
%le rayon
% % un point du cercle unite
for i:=80 step (-0.5) until -80:
C:=(cosd(i),sind(i))*u;
D:=25[O,C]; %le point D assez loin :-)
%on dessine le rayon
rayon:=O--D;
%on determine P
P:=verticale intersectionpoint rayon;
%les points de la courbe
% % on recupere la longueur OP
long:=arclength(O--P);
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;
endfor;
%on dessine
if (j mod 4)=0:
l:=l+1;
fond[l]:=image(
draw conchoideG withcolor 0.8white withpen pencircle scaled 1pt;
draw conchoideD withcolor 0.8white withpen pencircle scaled 1pt;
);
fi;
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);
%titre legende
label(btex $\rho=\frac{a}{\cos \theta}\pm b$ etex, (8u,6u));
label.lft(btex $a=3$ etex , (8.3u,-5u));
label.lft(btex $b=$ etex ,(8u,-6u));
label.rt((decimal (b/u)),(8u,-6u));
%on clip
clip currentpicture to cadre[0]--cadre[1]--cadre[2]--cadre[3]--cycle;
draw cadre[0]--cadre[1]--cadre[2]--cadre[3]--cycle withcolor white;
endfig;
endfor;
j:=j+1;
endfor;
end.