%  En préambule,  les  sources metapost.  Si  vous lancez  latex  sur ce  fichier,  il vous  placera
% automatiquement le fichier .mp dans le répertoire courant. 
\begin{filecontents*}{prog_lin.mp}






%input newcourbes;
%input couleur;
input geometriesyr16;
%input Surfaces;
%input TEX;

verbatimtex
%&latex
\documentclass{article}
\usepackage[upright]{fourier}
\usepackage{preambule}
\begin{document}
etex



vardef Droite(expr m,p) =
  numeric x,X;
  x:=xpart coinbg;
  X:=xpart coinbd;
  u*(x,(m*x+p))--(X,(m*X+p))*u
enddef;

vardef Droitex(expr k) =
  numeric y,Y;
  y:=ypart coinhg;
  Y:=ypart coinbd;
  u*(k,y)--(k,Y)*u
enddef;



numeric u;
u:=0.1cm;



for j:=1 upto 30 :
  

beginfig(j)

feuille(-10u,-10u,150u,150u);


pair A,B,C,D;
path tours,touri,d[],hachure[];
color col[]; 

tours:=coinbg--coinbd--coinhd--coinhg--0.99[coinhg,coinbg];
touri:=coinhd--coinhg--coinbg--coinbd--0.99[coinbd,coinhd];

col[0]:=ciel;
col[1]:=0.8white;
col[2]:=jaune;
col[3]:=orange;


d[0]:=Droitex(50);
d[1]:=Droite(0,20);
d[2]:=Droite(-1,180);
d[3]:=Droite(-1.5,240);

for i:=0 upto 1 :
  draw d[i];
  hachure[i]:=buildcycle(d[i],touri);
  fillcolor:=col[i];
  transparence hachure[i];
endfor;


for i:=2 upto 3 :
  draw d[i];
  hachure[i]:=buildcycle(d[i],tours);
  fillcolor:=col[i];
  transparence hachure[i];
endfor;


draw Droite(-1.25,200+j) withpen pencircle scaled 1.5bp;
%draw Droite(-1.25,200) withpen pencircle scaled 1.5bp;
draw Droite(-1.25,210) withpen pencircle scaled 1.5bp dashed evenly withcolor red;

dotlabel.ulft(btex A etex, d[0] intersectionpoint d[1] );
dotlabel.lft(btex B etex, d[0] intersectionpoint d[2] );
dotlabel.urt(btex C etex, d[2] intersectionpoint d[3] );
dotlabel.llft(btex D etex, d[1] intersectionpoint d[3] );

trace axes;

endfig;




endfor;


end


\end{filecontents*}




\documentclass{article}

\usepackage{multido,filecontents}
\usepackage{graphicx}
\usepackage[a4paper]{geometry}

\begin{document}
\multido{\i=1+1}{30}{\includegraphics[width=\textwidth]{prog_lin.\i}\newpage}
\end{document}












