prologues := 3;
outputtemplate := "%j/%j-%c.svg";
outputformat := "svg";
verbatimtex
%&latex
\documentclass{article}
\usepackage[charter]{mathdesign}
\usepackage{amsmath}
\begin{document}
etex
u:=1.2cm;
path para;
picture env[];
def milieu(expr a,b) = .5[a,b] enddef;
for i:=(-200) upto (200):
beginfig(i+200);
pair P,M,O,N,Q;
path drPQ, medPQ, horiP,seg;
seg:=(-0.1u,-0.1u)--(.1u,.1u);
O:=(0,0);
Q:=(2u,0);
drawarrow (-u,0)--(7u,0);
drawarrow (0,-4u)--(0,4u);
P:=(0,i/50*u);
N:= milieu(P,Q);
drPQ:=12[P,Q]--12[Q,P];
medPQ:= drPQ rotatedaround (N,90);
horiP:= (-12u,ypart P)--(12u,ypart P);
M:= horiP intersectionpoint medPQ;
env[i]:=image(%
draw medPQ withcolor 0.9*white;
);
if i=-200:
para:=M;
else:
para:=para--M;
fi;
for j:=-200 step 8 until i:
draw env[j];
endfor;
draw drPQ withcolor green dashed evenly withpen pencircle scaled 0.8pt;
draw medPQ withcolor green dashed evenly withpen pencircle scaled 0.8pt;
draw horiP withcolor green dashed evenly withpen pencircle scaled 0.8pt;
draw para withcolor red withpen pencircle scaled 1pt;
draw seg shifted milieu(Q,N);
draw seg shifted milieu(P,N);
dotlabel.llft(btex $O$ etex,O);
dotlabel.urt(btex $Q$ etex,Q);
dotlabel.lft(btex $P$ etex,P);
dotlabel.llft(btex $N$ etex,N);
dotlabel.urt(btex $M$ etex,M);
label.llft(btex $x$ etex,(7u,0));
label.lrt(btex $y$ etex,(0,4u));
label(btex \textit{La parabole} etex, (5u,2u));
clip currentpicture to (-u,-4u)--(7u,-4u)--(7u,4u)--(-u,4u)--cycle;
endfig;
endfor;
end.