%@AUTEUR:Guillaume Connan
prologues:=2;

verbatimtex
%&latex
\documentclass{article}
\begin{document}
etex

input courbes;
input geo;

color vert_e, turquoise, orange, vert_fonce, rose, vert_mer, bleu_ciel, or, rouge_v,bleu_m,bleu,bleu_f;
vert_e:=(0,0.790002,0.340007);
turquoise:=(0.250999,0.878399,0.815699);
orange:=(0.589999,0.269997,0.080004);
vert_fonce:=(0,1.4*0.392193,0);
rose:=(1.0, 0.752907, 0.796106);
bleu_ciel:=(1.2*0.529405,1.2*0.807794,1);%.2*0.921598);
or:=(1,0.843104,0);
rouge_v:=(0.829997,0.099994,0.119999);
bleu_m:=(0.7*0.529405,0.7*0.807794,0.7);%*0.921598);
bleu_f:=(0.211762,0.3231176,0.3686392);
bleu:=(0.529405,0.807794,1);

%%%   ROLLE

vardef droite(expr a,b,t) =
  (t[a,b])--(t[b,a])
enddef;

path c,cartouche;
c=(2.8cm,2.7cm)..(3.5cm,3.2cm)..(7.5cm,3.2cm)..(7.8cm,2.6cm);
cartouche = (4cm,2mm)--(9cm,2mm)--(9cm,8mm)--(4cm,8mm)--cycle;

pair A,M;
A = point 1 of c;
M = point 2 of c;

vardef tangente(expr t,x) =
  pair X,Y;
  X := point (t-.05) of c;
  Y := point (t+.05) of c;
  droite(X,Y,x)
enddef;


beginfig(1);
  repere(10cm,5cm,2cm,2cm,1cm,1cm);
  rtrace.axes(0.5pt);
  
%% lectures sur la grille
  numeric xa,ya,xm,ym,xc,yc;
  xa = 1.5; ya = 1.2 ; xm = 5.5 ; ym = 1.2;
  xc = 3.8 ; yc =1.95;
  pair AA,MM,CC;
  AA = (xa,ya) ; MM = (xm,ym) ; CC = (xc,yc);
  projection.axes(AA,0.5,1.7);
  projection.axes(MM,0.5,1.7);
  draw (CC--(xc,0)) en_place dashed evenly scaled 1.7 withpen pencircle scaled 0.5;
  label(btex $a$ etex,rpoint(xa,-0.2));
  label(btex $b$ etex,rpoint(xm,-0.2));
  label(btex $c$ etex,rpoint(xc,-0.2));
  label.lft(btex $f(b) = f(a)$ etex, rpoint(0,ym));
%% fin des lectures
 
  draw c withpen pencircle scaled 1.5pt withcolor bleu_f;
 
  draw droite(A,M,1.2);
 
  draw tangente(1.53325,6) withpen pencircle scaled 1.5pt withcolor 0.6white;
 
  dotlabel.lrt(btex $A$ etex ,A);
 
  dotlabel.llft(btex $B$ etex ,M);
 
  label.lrt(btex $\mathcal{C}_f$ etex ,point 3 of c);

  decoupe.repere;
  etiquette.axes;
endfig;
end