Fichier scarabee.mp (figure 1) — Modifié le 13 Avril 2008 à 13 h 13

scarabee.mp (figure 1)
Source

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

prologues:=2;

input geometriesyr16;
u:=2cm;
figure(-10u,-10u,10u,10u);
pair A,B,C,D,O,I,J,M[],N[],P[],G[],H[];
I=(0,0);
A-I=u*(5,0);
B=rotation(A,I,90);
C=symetrie(A,I);
D=symetrie(B,I);
J=u*(5*cosd(45)*sind(45)*cosd(45),5*cosd(45)*sind(45)*sind(45));
path dd,de;
dd=droite(C,A);
de=droite(B,D);
O=iso(I,J);
for k=0 step 0.1 until 100:
  M[k]=(k/100)[C,A];
  N[k]=cercles(M[k],5u) intersectionpoint de;
  P[k]=symetrie(N[k],I);
endfor;
for k=0 step 0.1 until 100:
  G[k]=droite(M[k],N[k]) intersectionpoint perpendiculaire(M[k],N[k],O);
  H[k]=droite(M[k],P[k]) intersectionpoint perpendiculaire(M[k],P[k],O);
endfor;
drawoptions(withcolor rouge);
path scarabee;
scarabee=G0
for k=0.1 step 0.1 until 100:
  --G[k]
endfor
for k=0 step 0.1 until 100:
  --H[k]
endfor
--cycle;
trace scarabee;
drawoptions(withcolor bleu);
trace textpath("\Large Scarabée",scarabee,0.68);
fin;
end