La lemniscate de Bernoulli par anti-parallèlogramme

Animation flash


lemniscate1.mp
%@DATE: 30 mai 2005
 
input fichierps;
 
InitFichierPS(-120,-120,210,120);
u = 1.2cm;
 
% La distance de base.
d = 3;
 
% Les points fixes
pair A, B;
A = (0,0);
B = (d,0) scaled u;
 
% Les deux cercles
path cA, cB;
cA = fullcircle scaled (sqrt(2)*d) scaled u shifted A;
cB = fullcircle scaled (sqrt(2)*d) scaled u shifted B;
 
% Les articulations.
pair C,D,L;
 
vardef Point(expr p) =
    draw p withpen pencircle scaled 4;
    draw p withpen pencircle scaled 3 withcolor white;
enddef;
 
% La lemniscate.
path l;
 
 
for i=0 upto 180:
  beginfig(i+1);
 
    D := point (8*i/180.5+0.01) of cA;
    C := (D + B - A) reflectedabout (B,D);
    L := .5[D,C];    
 
    fill cA withcolor 0.8white;
 
    drawoptions(withcolor 0.6white);    
    draw cA;
    draw cB;
    drawoptions();
 
    drawarrow subpath (0,8*i/180.5) of cA;
 
    if i=0: 
	l := L;
    else:
	l := l -- L;
	draw l withpen pencircle scaled 1 withcolor blue;
    fi
 
    drawoptions(withpen pensquare scaled 2 withcolor (1,0.08,0.58));	
    draw A--B;
    draw A--D;
    draw B--C;
    draw D--C;
    drawoptions();
 
    Point(A);
    Point(B);
    Point(C);
    Point(D);
    Point(L);    
 
  endfig;
endfor;
 
end