khayyam.mp [ source brut ]
input courbes; %% ======================================== fonction(s) vardef fx(expr t) = t enddef; vardef fy(expr t) = t*t/2 enddef; %% ======================================== figure(s)
beginfig(1) repere(6cm,6cm,2cm,1cm,1cm,1cm); trace.axes(1pt); path parabole, cercle; parabole = ftrace(-2,4,20) scaled 1cm shifted origine; cercle = fullcircle rotated -80 scaled 3cm shifted (3.5cm,1cm); z1 = ((parabole cutbefore ((1cm,0.5cm) shifted origine)) intersectionpoint cercle); z2 = (x1,1cm); z3 = (3cm,0) shifted origine; draw parabole; draw cercle; draw z1--z2; pickup pencircle scaled 1pt; draw origine--z2 withcolor red; dotlabel.ulft(btex $P$ etex,z1); dotlabel.llft(btex $Q$ etex,z2); dotlabel.llft(btex $A$ etex,z3); dotlabel.llft(btex $O$ etex,origine); decoupe.repere; endfig; end