Retour

Source : puzzlepytha.mp

Animation flash


puzzlepytha.mp
input geometriesyr16;
u:=7.5mm;
%%Points
figure(2u,0,14u,12u);
trace feuillet withcolor blanc;
pair a[];
a0=u*(6,6);%label.llft(btex $B$ etex,a0);
a1=u*(11,6);%label.lrt(btex $C$ etex,a1);
a3=a0 rotatedabout(a1,-35);
a2=(mediatrice(a3,a1) shifted(a0-iso(a3,a1))) intersectionpoint demidroite(a1,a3);%label.top(btex $A$ etex,a2);
a4=((a1 rotatedabout(a2,90))--a1) intersectionpoint ((a2 rotatedabout(a1,-90))--a2);
a5=(droite(a0,a1) shifted(a4-a0)) intersectionpoint (a2--(a1 rotatedabout(a2,90)));
a6=((a2 rotatedabout(a0,90))--a2) intersectionpoint ((a0 rotatedabout(a2,-90))--a0);
a7=((a1 rotatedabout(a0,-90))--a1) intersectionpoint ((a0 rotatedabout(a1,90))--a0);
picture fond;
fond=image(
  trace codeperp(a0,a2,a1,5);
  trace a0--a1--a2--cycle;
  trace a0--(a2 rotatedabout(a0,90))--(a0 rotatedabout(a2,-90))--a2;
  trace a0--(a1 rotatedabout(a0,-90))--(a0 rotatedabout(a1,90))--a1;
  trace a2--(a1 rotatedabout(a2,90))--(a2 rotatedabout(a1,-90))--a1;
  trace a5--symetrie(a5,a4);
  trace (a5 rotatedabout(a4,-90))--(a5 rotatedabout(a4,90));
  );
draw fond;
fin;
picture piece[];
path pieces[];
piece1=image(
  pieces1=a0--(a2 rotatedabout(a0,90))--(a0 rotatedabout(a2,-90))--a2--cycle;
  fill pieces1 withcolor (red+blue);
  draw pieces1;
  );
piece2=image(
  pieces2=a5--a4--(a5 rotatedabout(a4,-90))--(a1 rotatedabout(a2,90))--cycle;
  fill pieces2 withcolor (red+green);
  draw pieces2;
  );
piece3=image(
  pieces3=a4--symetrie(a5,a4)--(a2 rotatedabout(a1,-90))--(a5 rotatedabout(a4,-90))--cycle;
  fill pieces3 withcolor (green+blue);
  draw pieces3;
  );
piece4=image(
  pieces4=a1--symetrie(a5,a4)--a4--(a5 rotatedabout(a4,90))--cycle;
  fill pieces4 withcolor 0.75[red,green];
  draw pieces4;
  );
piece5=image(
  pieces5=a2--a5--a4--(a5 rotatedabout(a4,90))--cycle;
  fill pieces5 withcolor 0.25[red,blue];
  draw pieces5;
  );
figure(2u,0,14u,12u);
trace feuillet withcolor blanc;
draw fond;
draw piece1;
draw piece2;
draw piece3;
draw piece4;
draw piece5;
fin;
vues=5;
for vue=1 upto vues:
  figure(2u,0,14u,12u);
  trace feuillet withcolor blanc;
  draw piece1;
  draw piece3;
  draw piece4;
  draw piece5;
  draw (piece2 shifted ((vue/vues)*(a1-a4))) rotatedabout(a1,(vue/vues)*90);
  draw fond;
  fin;
endfor
for vue=1 upto vues:
  figure(2u,0,14u,12u);
  trace feuillet withcolor blanc;
  draw (piece2 shifted (a1-a4)) rotatedabout(a1,90);
  draw piece4;
  draw piece5;
  draw piece1;
  draw (piece3 shifted ((vue/vues)*((a0 rotatedabout(a1,90))-a4))) rotatedabout(a0 rotatedabout(a1,90),(vue/vues)*90);
  draw fond;
  fin;
endfor
for vue=1 upto vues:
  figure(2u,0,14u,12u);
  trace feuillet withcolor blanc;
  draw (piece2 shifted (a1-a4)) rotatedabout(a1,90);
  draw (piece3 shifted ((a0 rotatedabout(a1,90))-a4)) rotatedabout(a0 rotatedabout(a1,90),90);
  draw piece5;
  draw piece1;
  draw (piece4 shifted ((vue/vues)*((a1 rotatedabout(a0,-90))-a4))) rotatedabout(a1 rotatedabout(a0,-90),(vue/vues)*90);
  draw fond;
  fin;
endfor
for vue=1 upto vues:
  figure(2u,0,14u,12u);
  trace feuillet withcolor blanc;
  draw (piece2 shifted (a1-a4)) rotatedabout(a1,90);
  draw (piece3 shifted ((a0 rotatedabout(a1,90))-a4)) rotatedabout(a0 rotatedabout(a1,90),90);
  draw (piece4 shifted ((a1 rotatedabout(a0,-90))-a4)) rotatedabout(a1 rotatedabout(a0,-90),90);
  draw piece1;
  draw (piece5 shifted ((vue/vues)*(a0-a4))) rotatedabout(a0,(vue/vues)*90);
  draw fond;
  fin;
endfor
for vue=1 upto vues:
  figure(2u,0,14u,12u);
  trace feuillet withcolor blanc;
  draw (piece2 shifted (a1-a4)) rotatedabout(a1,90);
  draw (piece3 shifted ((a0 rotatedabout(a1,90))-a4)) rotatedabout(a0 rotatedabout(a1,90),90);
  draw (piece4 shifted ((a1 rotatedabout(a0,-90))-a4)) rotatedabout(a1 rotatedabout(a0,-90),90);
  draw (piece5 shifted (a0-a4)) rotatedabout(a0,90);
  draw piece1 shifted ((vue/vues)*(a7-a6));
  draw fond;
  fin;
endfor
end