input latexmp;
setupLaTeXMP(class="article",options="12pt",fontencoding="T1",inputencoding="latin1",language="frenchb",packages="fourier,textpathmp");
input textpath;
prologues:=2;
input geometriesyr16;
figure(0,u,10u,10u);
pair O,A,M[],N[];
O=u*(5,5);
path cc;
cc=cercles(O,3u);
A=pointarc(cc,30);
for k=0 step 1 until 360:
M[k]=pointarc(cc,k);
N[k]=parallele(O,M[k],A) intersectionpoint perpendiculaire(O,M[k],M[k]);
endfor;
drawoptions(dashed evenly withcolor gris);
trace cc;
drawoptions(withcolor rouge);
path cardioide;
cardioide=N1
for k=2 upto 360:
--N[k]
endfor
--cycle;
trace cardioide;
drawoptions(withcolor bleu);
trace textpath("\Large Cardioïde",cardioide,0.75);
fin;
end