La cardio´de comme enveloppe de cercles

Animation flash


cardioide.mp
R = 80;
picture pict;
 
color c[];
c1 = (0.82,0.13,0.56); % VioletRed;
c2 = (0.21,0.39,0.55); 
 
pict := image (
    fill fullcircle scaled 2R withcolor 0.5[c1,white];
    draw fullcircle scaled 2R withcolor c1 withpen pencircle scaled 2;
    );
 
pair P,Q;
P := (0,R);
 
for i=0 upto 72:
    beginfig(i+1);
	draw pict;
 
	Q := R*(cosd(i*5+90),sind(i*5+90));
 
	draw fullcircle scaled 2abs(Q-P) shifted Q
	    withpen pencircle scaled 0.5
	    withcolor 0.6white;
 
	pict := currentpicture;
 
	draw Q withpen pencircle scaled 5 withcolor c2;
 
	draw (-3R,2R)--(-3R,-3R)--(3R,-3R)--(3R,2R)--cycle
	    withcolor white;
    endfig;
endfor;
 
end