%-*- coding: iso-8859-15 -*-
% Time-stamp: <2008-06-14T19:16:55 (cest) [yvon sur hypatie]>
% création : 2008-06-14T18:11
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%        Le triangle chromatique de Goethe         %%%%%%%%%%
%%%%%%%%%%                     d'après                      %%%%%%%%%%
%%%%%%%%%%          « Les théories de la couleur »          %%%%%%%%%%
%%%%%%%%%%         Paul Zelanski et Mary Pat Fisher         %%%%%%%%%%
%%%%%%%%%%              Thalia Édition © 2006               %%%%%%%%%%
%%%%%%%%%%               ISBN: 2-35278-007-1                %%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%         code par le TeXnicien de surface         %%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
numeric u;
u:=1cm;


beginfig(1);
  for k=0 upto 3:
    z[0][k]=(origin shifted (3*k*u*right)) rotated 30;
    z[2][k]=(origin shifted ((9-3*k)*u*right)) rotated 90;
  endfor;
  z[1][0]=z[0][3];
  z[1][3]=z[2][0];
  for k=1 upto 2: z[1][k] = (k/3)[z[1][0],z[1][3]]; endfor;
  
  draw for k=0 upto 2: z[k][0]-- endfor cycle;

  for j=0 upto 2:
    for k=1, 2: draw z[j][k]--z[(j+1) mod 3][3-k];endfor;
  endfor;

  z0 = whatever[z[0][1],z[1][2]] = whatever[z[2][2],z[1][1]];

  color coul[], yellow;
  yellow:=(1,1,0);
  coul0:=blue; coul1:=red; coul2:=yellow;
  for k=0 upto 2:
    fill z[k][0]--z[k][1]--z[(k+2)mod3][2]--cycle withcolor coul[k];
  endfor;
  for k=0 upto 2:
    coul[k+3]=0.5[coul[k],coul[(k+1) mod 3]];
  endfor;
  for k=0 upto 2:
    fill z[k][1]--z0--z[k][2]--cycle withcolor coul[k+3];
  endfor;
  for k=0 upto 2:
    coul[k+6]=0.5[coul[3+k],coul[3+((k+2) mod 3)]];
  endfor;
  for k=0 upto 2:
    fill z[k][1]--z0--z[(k+2)mod 3][2]--cycle withcolor coul[k+6];
  endfor;
endfig;

end