La strophoïde

Animation flash


strophoide.mp
input courbes; 
vardef fx(expr t) = 
 2*cos(2*t) 
enddef; 
vardef fy(expr t) = 
 2*cos(2*t)*tan(t) 
enddef; 
 
% valeur utilisée pour le paramètrage.
numeric PI;
PI := 3.1;
 
 
vues := 60;
for vue=1 upto vues:
    beginfig(vue);
	repere(11cm,18cm,5.5cm,9cm,2cm,2cm); 
 
	% marque.unites(1mm); 
 
	numeric t; 
	path rayon,cercle; 
	pair A,B,P,O,Q; 
 
	t = -PI/2 + (vue-1)*PI/2/(vues-1); 
	A = (2,0); 
	O = (0,0); 
 
	if vue=1: 
    	    Q = (2,3*r_ymax); 
	    P = (fx(t+PI/2),fy(t+PI/2)); 
	elseif vue=vues: 
	    Q = (fx(t),fy(t)); 
	    P = (2,3*r_ymin); 
	else: 
	    Q = (fx(t),fy(t)); 
	    P = (fx(t+PI/2),fy(t+PI/2)); 
	fi 
 
	B = .5[P,Q]; 
	rayon = 2[B,A]--2[A,B]; 
 
	if vue=1: 
	% rien ! 
	elseif vue=vues: 
	    drawarrow ftrace(-1.4,1.4,100) en_place 
		withpen pencircle scaled 1.5pt 
		withcolor 0.2[blue,red]; 
	else: 
	    draw fullcircle 
		scaled (2*abs(O-B)*unite) 
		shifted (B en_place) 
		withpen pencircle scaled 1pt 
		withcolor 0.3white; 
	    drawarrow ftrace(-1.4,t-0.01,100) en_place 
		withpen pencircle scaled 1.5pt 
		withcolor 0.2[blue,red]; 
	    drawarrow ftrace(0,t-0.01+Pi/2,100) en_place 
		withpen pencircle scaled 1.5pt 
		withcolor 0.2[blue,red]; 
	fi 
 
	% Tracé du rayon 
	draw rayon en_place; 
 
	% Points 
	draw A en_place withpen pencircle scaled 5pt 
	    withcolor blue; 
	draw P en_place withpen pencircle scaled 5pt 
	    withcolor blue; 
	draw B en_place withpen pencircle scaled 5pt 
	    withcolor blue; 
	draw Q en_place withpen pencircle scaled 3pt; 
 
	label.llft(btex $A$ etex scaled 2,A en_place); 
	label.llft(btex $B$ etex scaled 2,B en_place); 
 
	decoupe.repere; 
	trace.axes(0.5pt); 
 
	etiquette.axes; 
 
	dotlabel.llft(btex $O$ etex scaled 2,rpoint(0,0)); 
 
	draw rpoint(r_xmin-0.2,r_ymin-0.2)-- 
	    rpoint(r_xmin-0.2,r_ymax+0.2)-- 
	    rpoint(r_xmax+0.2,r_ymax+0.2)-- 
	    rpoint(r_xmax+0.2,r_ymin-0.2)--cycle 
		withpen pencircle scaled 1.5pt 
		withcolor (0.8,0.6,0.1);
    endfig;
endfor
 
end