# Animation (2) sur Pythagore

pythagore2

input geometriesyr16.mp ;

u:=1cm;

numeric xmin,xmax,ymin,ymax;
xmin:=-u;
xmax:=10u;
ymin:=-u;
ymax:=10u;

%---------------------------------- Définitions générales utilisées
%                                   sur toutes les figures
pair A,B,C,D,E,F,G,H,I;
numeric a,b;
a:=6;
b:=3;

A:=(0,0);
B:=((a+b)*u,0);
C:=((a+b)*u,(a+b)*u);
D:=(0,(a+b)*u);
E:=(a*u,0);
F:=((a+b)*u,b*u);
G:=(a*u,(a+b)*u);
H:=(0,b*u);
I:=(a*u,b*u);

draw polygone(A,B,C,D);

picture fig;
path poly;

fig:=currentpicture;
currentpicture:=nullpicture;

beginfig(1)
fill polygone(G,C,I) withcolor orange;
draw polygone(G,C,I);

fill polygone(F,C,I) withcolor orange;
draw polygone(F,C,I);

fill polygone(H,I,E) withcolor orange;
draw polygone(H,I,E);

fill polygone(A,H,E) withcolor orange;
draw polygone(A,H,E);

%------------------------------- Tracé de la figure
draw fig ;
draw cadre withcolor black withpen pencircle scaled 2pt;
endfig;

for i:=0 upto 10:
beginfig(i+2)
fill polygone(F,C,I) withcolor orange;
draw polygone(F,C,I);

fill polygone(H,I,E) withcolor orange;
draw polygone(H,I,E);

fill polygone(A,H,E) withcolor orange;
draw polygone(A,H,E);

poly := polygone(G,C,I) shifted (0.1*i*(D-G));
fillcolor:=blue;
transparence poly;
%------------------------------- Tracé de la figure
draw fig ;
draw cadre withcolor black withpen pencircle scaled 2pt;
endfig;
endfor;

for i:=0 upto 10:
beginfig(i+13)
fill polygone(H,I,E) withcolor orange;
draw polygone(H,I,E);

fill polygone(A,H,E) withcolor orange;
draw polygone(A,H,E);

fill polygone(G,C,I) shifted (D-G) withcolor orange;
draw polygone(G,C,I) shifted (D-G);

poly := polygone(F,C,I) shifted (0.1*i*(B-F));
fillcolor:=blue;
transparence poly;
%------------------------------- Tracé de la figure
draw fig ;
draw cadre withcolor black withpen pencircle scaled 2pt;
endfig;
endfor;

for i:=0 upto 10:
beginfig(i+24)
fill polygone(A,H,E) withcolor orange;
draw polygone(A,H,E);

fill polygone(G,C,I) shifted (D-G) withcolor orange;
draw polygone(G,C,I) shifted (D-G);

fill polygone(F,C,I) shifted (B-F) withcolor orange;
draw polygone(F,C,I) shifted (B-F);

poly := polygone(H,I,E) shifted (0.1*i*(C-I));
fillcolor:=blue;
transparence poly;
%------------------------------- Tracé de la figure
draw fig ;
draw cadre withcolor black withpen pencircle scaled 2pt;
endfig;
endfor;

beginfig(35)
fill polygone(G,C,I) shifted (D-G) withcolor orange;
draw polygone(G,C,I) shifted (D-G);

fill polygone(F,C,I) shifted (B-F) withcolor orange;
draw polygone(F,C,I) shifted (B-F);

fill polygone(H,I,E) shifted(C-I) withcolor orange;
draw polygone(H,I,E) shifted(C-I);

fill polygone(A,H,E) withcolor orange;
draw polygone(A,H,E);

%------------------------------- Tracé de la figure
draw fig ;