Ellipsographe de Van Shooten
%@DATE: 31 mai 2005
input fichierps;
InitFichierPS(-200,-120,200,120);
u = 1.2cm;
% Le point fixe.
pair A;
A = (0,0);
% Le tiers de la longueur du bras.
l = 1.8;
vardef Point(expr p) =
draw p withpen pencircle scaled 4;
draw p withpen pencircle scaled 3 withcolor white;
enddef;
% L'ellipse;
path e;
for i=0 upto 200:
beginfig(i+1);
pair B,C,E;
if i<=50:
C = (i*l/25,0) scaled u;
elseif i<=150:
C = (4l-i*l/25,0) scaled u;
else:
C = (i*l/25-8l,0) scaled u;
fi;
x := (xpart C)/2/u;
k := l*sqrt(1-(x/l)*(x/l));
B := (x,k) scaled u;
if (i>50) and (i<150):
B := B yscaled -1;
fi;
E = 2[B,C];
drawoptions(withcolor 0.6white);
draw ((-3.5l,0)--(3.5l,0)) scaled u;
draw ((0,1.5l)--(0,-1.5l)) scaled u;
drawoptions();
drawarrow A--(C scaled 0.95) withpen pencircle scaled 1.25;
if i=0:
e := E;
else:
e := e -- E;
draw e withpen pencircle scaled 1 withcolor blue;
fi
drawoptions(withpen pensquare scaled 2 withcolor (1,0.08,0.58));
draw A--B--E;
drawoptions();
Point(A);
Point(B);
Point(C);
Point(E);
endfig;
endfor;
end