input courbescp13;

beginfig(1);
  cadre((0,0),(10,8));
  draw grille(0.5) withcolor gris;
  origine((5,3.5));
  unites(1,1);
  draw axes;
  legendex(btex $x$ etex);
  legendey(btex $f(x)$ etex);
  draw placepoint(-5,3)..placepoint(-4,2)..placepoint(-3,0.5)..placepoint(-2,-1)..placepoint(-1,0)..placepoint(0,2)..placepoint(1,4)..placepoint(2,3)..placepoint(3,1)..placepoint(4,-1)..placepoint(5,-3);
  graduationx(btex 1 etex,1);
  graduationy(btex 1 etex,1);
endfig;

beginfig(2);
  cadre((0,0),(10,7));
  draw grille(0.5) withcolor gris;
  origine((3,1));
  unites(1,1);
  graduationx(btex 1 etex,1);
  graduationy(btex 1 etex,1);
  draw axes;
  legendex(btex $x$ etex);
  draw placepoint(-3,1)..placepoint(-2.15,1.9)..placepoint(0,3.2)..placepoint(2,3)..placepoint(5,4)..placepoint(6,5)..placepoint(6.5,6);
  pair A,B,C,D,E,F,K;
  A=placepoint(2,3);
  B=placepoint(2,0);
  C=placepoint(5,4);
  D=placepoint(5,0);
  E=placepoint(0,3);
  F=placepoint(0,4);
  K=placepoint(-2.15,1.9);
  dotlabel.top(btex $A$ etex,A);
  dotlabel.top(btex $C$ etex,C);
  dotlabel.top(btex $K$ etex,K);
  draw Projection(A);
  draw Projection(C);
  label.bot(btex $B$ etex,B);
  label.bot(btex $D$ etex,D);
  label.lft(btex $E$ etex,E);
  label.lft(btex $F$ etex,F);
endfig;
end