Hyperbolographe de Delaunay

hyperbolographe1.mp
```%@DATE: 31 mai 2005

input fichierps;

InitFichierPS(-120,-190,120,190);

u = 1cm;

% La longueur du bras AM.
l = 4;

% La longueur du bras AB.
L = 4.2; % L > l

% Angle des deux glissières;
a = 40;
ca = cosd(a);
sa = sind(a);

vardef Point(expr p) =
draw p withpen pencircle scaled 4;
draw p withpen pencircle scaled 3 withcolor white;
enddef;

% Les deux branches de l'hyperbole.
path hg,hd;

for i=0 upto 200:
beginfig(i+1);

pair A,B,C,D,M;

if i<=50:
M = (sa,ca) scaled (i*l/50) scaled u;
elseif i<=150:
M = (sa,ca) scaled (2l-i*l/50) scaled u;
else:
M = (sa,ca) scaled (i*l/50-4l) scaled u;
fi;

y := (ypart M)/u;
x := (xpart M)/u;

k := l*sqrt(1-(x/l)*(x/l));
h := L*sqrt(1-(k/L)*(k/L));

A = (0,y+k) scaled u;
C = (0,y-k) scaled u;
B = (-h,y) scaled u;
D = (h,y) scaled u;

FondImage((1,.87,.68));
drawoptions(withcolor 0.6white);
draw ((0,-1.6l)--(0,1.6l)) scaled u;
draw ((0,-1.1l)--(0,1.1l)) rotated -a  scaled u;
drawoptions();

drawarrow (0,0)--(M scaled 0.95) withpen pencircle scaled 1.25;

if i=0:
hg := B;
hd := D;
else:
hg := hg -- B;
hd := hd -- D;
draw hd withpen pencircle scaled 1 withcolor blue;
draw hg withpen pencircle scaled 1 withcolor blue;
fi

drawoptions(withpen pensquare scaled 2 withcolor (.55,.35,.17));
draw A--B--C--D--A;
draw A--M--C;
drawoptions();

Point(A);
Point(B);
Point(C);
Point(D);
Point(M);
endfig;
endfor;

end```