input latexmp;
setupLaTeXMP(class="article",options="12pt",fontencoding="T1",inputencoding="latin1",language="frenchb",packages="fourier,textpathmp");
input textpath;

prologues:=2;

input geometriesyr16;

figure(-2u,u,8u,7u);
pair O,A,B,P[],Q[],M[],N[];
path cc;
O=u*(3,4);
A-O=u*(4,0);
B=rotation(A,O,-90);
cc=cercles(iso(O,A),A);
for k=182 step 5 until 540:
  P[k]=pointarc(cc,k);
  Q[k]=droite(O,B) intersectionpoint perpendiculaire(O,B,P[k]);
  M[k]=droite(Q[k],P[k]) intersectionpoint cercles(Q[k],abs(O-P[k]));
  N[k]=symetrie(M[k],Q[k]);
  if xpart(M[k])<xpart(O):
    M[k]:=N[k];
    N[k]:=symetrie(M[k],Q[k]);
  fi;
endfor;
drawoptions(dashed evenly withcolor gris);
trace cc;
drawoptions(withcolor rouge);
path huit;
huit=M182
for k=187 step 5 until 540:
  --M[k]
endfor
for k=182 step 5 until 540:
  --N[k]
endfor
--cycle;
trace huit;
drawoptions(withcolor bleu);
trace textpath("\Large Huit",huit,0.75);
fin;
end