# Animations

## Conchoïdes de Nicomède (variations)

conch_nico_var.mp
%@AUTEUR: Maxime Chupin
%@DATE: 16 novembre 2009

verbatimtex
%&latex
\documentclass{minimal}
\usepackage[charter]{mathdesign}
\begin{document}
etex
% unitee
u:=1cm;

%% 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
%les chemins necessaires
path verticale, conchoideG, conchoideD,rayon;
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
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 scaled 1.5, (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
end.