Développante d'un cercle
%@AUTEUR: Maxime Chupin
%@DATE: 18 octobre 2009
verbatimtex
%&latex
\documentclass{minimal}
\usepackage[utf8]{inputenc}
\usepackage[garamond]{mathdesign}
\begin{document}
etex
u:=1cm;
%% === style.mp --------------------------------------------------------(JMS)
picture UnBeauPoint;
UnBeauPoint := image(
fill fullcircle scaled 3pt;
fill fullcircle scaled 2pt withcolor white;
);
vardef pointe expr p = draw UnBeauPoint shifted p; enddef;
%% =
numeric pi;
pi:=3.14159;
path arc, cercle,dev;
for i:=0 upto 360:
beginfig(i);
pair P,M,vecTan;
color gris;
gris:=0.7*white;
draw fullcircle scaled 2u withcolor gris;
% P parcourant le cercle
P:=u*(cosd(i),sind(i));
if i=0:
arc:=P;
else:
arc:=arc--P
fi;
%on calcul la longueur de l'arc
numeric longueurArc;
longueurArc:= arclength(arc);
%vecteur normal
vecTan:=(sind(i),-cosd(i));
%le point de la developpante
M:=P+longueurArc*(vecTan);
if i=0:
dev:=M;
else:
dev:=dev--M;
fi;
draw arc withcolor blue;
draw (0,0)--P dashed evenly withcolor gris;
draw P--M dashed evenly withcolor blue;
draw dev withpen pencircle scaled 1pt withcolor red;
pointe (0,0);
pointe (u,0);
pointe P;
pointe M;
label.urt(btex $P$ etex, P);
label.urt(btex $M$ etex,M);
label.urt(btex \textit{Développante de cercle} etex,(-1.7*pi*u,-2*pi*u));
draw (2u,-2.1*pi*u)--(2u,1.2pi*u)--(-1.8*pi*u,1.2pi*u)--(-1.8*pi*u,-2.1*pi*u)--cycle withcolor white;
endfig;
endfor;
end.