input latexmp;
setupLaTeXMP(class="article",options="12pt",fontencoding="T1",inputencoding="latin1",language="frenchb",packages="fourier,textpathmp");
input textpath;
prologues:=2;
input geometriesyr16;
figure(u,0,14u,6u);
pair O,A,P[],N[],M[];
O=u*(7.5,3);
path cc,dd;
cc=cercles(O,2.5u);
A=pointarc(cc,90);
dd=perpendiculaire(O,A,A);
marque_p:="plein";
l=0;
for k=0 step 1 until 180:
P[k]=pointarc(cc,k);
if (dd intersectiontimes droite(O,P[k]))<>(-1,-1):
l:=l+1;
N[k]=dd intersectionpoint droite(O,P[k]);
M[l]=perpendiculaire(O,A,P[k]) intersectionpoint parallele(O,A,N[k]);
fi;
endfor;
p=3000;
for k=181 step 1 until 360:
P[k]=pointarc(cc,k);
if (dd intersectiontimes droite(O,P[k]))<>(-1,-1):
p:=p+1;
N[k]=dd intersectionpoint droite(O,P[k]);
M[p]=perpendiculaire(O,A,P[k]) intersectionpoint parallele(O,A,N[k]);
fi;
endfor;
drawoptions(dashed evenly withcolor gris);
trace cc;trace dd;
drawoptions(withcolor rouge);
path quartiquekulp[];
quartiquekulp1=M1
for k=2 upto l:
--M[k]
endfor;
quartiquekulp2=M3001
for k=3002 upto p:
--M[k]
endfor;
trace quartiquekulp1;
trace quartiquekulp2;
drawoptions(withcolor bleu);
trace textpath("\Large Quartique de Kulp",reverse(quartiquekulp1),0.4);
fin;
end