Une courbe de la bielle de Bérard est le lieu d'un
point lié à un segment de longueur constante joignant un cercle à une droite.
prologues := 3;
outputtemplate := "ber/%j-%c.svg";
outputformat := "svg";
verbatimtex
%&latex
\documentclass{minimal}
\usepackage[utf8]{inputenc}
\usepackage[charter]{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:=0.7cm;
pair O;
%Point fixe
O:=(0,0);
path ber[], cercle;
%diamètre du cercle
r:=2;
cercle=fullcircle scaled (2*r*u);
%demie longueur du segment
l:=4;
for i:=0 upto 360:
beginfig(i);
pair P,M[],N;
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);
M1:=2[P,N];
M2:=2[N,P];
M3:=0.5[N,P];
if i=0:
ber1:=M1;
ber2:=M2;
ber3:=M3;
else:
ber1:=ber1--M1;
ber2:=ber2--M2;
ber3:=ber3--M3;
fi;
pickup pencircle scaled 0.8pt;
draw O--(1.5*l*u,0);
draw cercle dashed evenly withcolor blue;
pickup pencircle scaled 1.3pt;
draw P--N withcolor green;
draw M1--M2 withcolor green;
draw O--P withcolor green;
pickup pencircle scaled 0.8pt;
pointe(O,jaune);
pointe(P,jaune);
pointe(N,jaune);
drawoptions(withpen pencircle scaled 1pt withcolor red);
draw ber1;
draw ber2;
draw ber3;
drawoptions();
pointe(M1,jaune);
pointe(M2,jaune)
pointe(M3,jaune);
label.top(btex \textit{Courbes de la bielle de } \textsc{Bérard} etex, (3*r*u,2*r*u));
draw (-4*r*u,-3*r*u)--(6*r*u,-3*r*u)--(6*r*u,3*r*u)--(-4*r*u,3*r*u)--cycle withcolor white;
endfig;
endfor;
end.