# Animations

## Les courbes de la bielle de Bérard (variations)

berard2.mp
%@AUTEUR: Maxime Chupin
%@DATE: 14 février 2008

verbatimtex
%&latex
\documentclass{minimal}
\usepackage[utf8]{inputenc}
\usepackage[garamond]{mathdesign}
\usepackage{amsmath}
\begin{document}
etex

color jaune;
jaune = red+green;

% === Pointer les points avec une couleur cerclée de noir.
def pointe(expr p,c) =
fill fullcircle scaled 3 shifted p withcolor black;
fill fullcircle scaled 2 shifted p withcolor c;
enddef;

u:=1cm;
pair O;
%Point fixe
O:=(0,0);
path ber[], cercle;
%diamètre du cercle
r:=2;
cercle=fullcircle scaled (2*r*u);
%quart de la longueur du segment
l:=4;

for j:=0 upto 200:
beginfig(j);
%boucle de tracé de la courbe pour un point du segment
for i:=0 upto 360:
pair P,M[],N;
path segment;
x:=cosd(i)*r*u;
y:=sind(i)*r*u;
P:=(x,y);
k:=sqrt(l*l-(y/u)*(y/u))*u;
N:=(x+k,0);
segment:=2[N,P]--2[P,N];
M3:=point (j/200) of segment;
if i=0:
ber3:=M3;
else:
ber3:=ber3--M3;
fi;
endfor;
%le cercle et la glissière
pickup pencircle scaled 0.8pt;
draw O--(1.5*l*u,0);
draw cercle dashed evenly withcolor blue;
%un petit arrière plan rappelant la construction
x:=cosd(20)*r*u;
y:=sind(20)*r*u;
P:=(x,y);
k:=sqrt(l*l-(y/u)*(y/u))*u;
N:=(x+k,0);
M1:=2[P,N];
M2:=2[N,P];
drawoptions(withpen pencircle scaled 1.6pt withcolor 0.8white);
draw O--P;
draw M1--M2;
fill fullcircle scaled 3 shifted O;
fill fullcircle scaled 3 shifted P;
fill fullcircle scaled 3 shifted N;
drawoptions();
%Le point du segment
M4:= point (j/200) of (M2--M1);
%on trace la courbe
drawoptions(withpen pencircle scaled 1pt withcolor red);
draw ber3;
drawoptions();
%et on met le point auquel se réfère la courbe
pointe(M4, jaune);
label.top(btex \textit{Courbes de la bielle de} \textsc{Bérard} \textit{(variations)} etex, (3*r*u,2*r*u));
endfig;
endfor;
end.