Duplicateur de Reuleaux

Animation flash


duplicateur.mp
%@DATE: 2 juin 2005
 
input fichierps;
 
InitFichierPS(-160,-160,160,160);
 
u = 0.8cm;
 
% la distance AB.
l = 3;
 
% Les points fixes.
pair A,B;
A = (0,0);
B = (l,0) scaled u;
 
% Les cercles.
path cp, cq;
cp = fullcircle scaled 4l scaled u;
 
vardef Point(expr p) =
    draw p withpen pencircle scaled 4;
    draw p withpen pencircle scaled 3 withcolor white;
enddef;
 
for i=0 upto 100:
    beginfig(i);
 
	FondImage((1,.89,.77));
	draw cp withcolor 0.6white;
 
	pair P,Q;
 
	P = point (.08i) of cp;
	Q = A reflectedabout(P,B);
 
	if i=0:
	    cq := Q;
	else:
	    cq := cq -- Q;
	    drawarrow subpath(0,0.08i) of cp
		withpen pencircle scaled 1;
	    draw cq withcolor (0,.55,.27);
	fi;
 
 
	drawoptions(withpen pensquare scaled 2 withcolor (.7,.13,.13));	
	draw A--P;
	draw P--Q;
	draw Q--B;
	draw B--A;
	drawoptions();
 
	Point(A);
	Point(B);
	Point(P);
	Point(Q);    
 
    endfig;
endfor;
 
end