Construction particulière de la cardioïde

Animation flash


animation.mp
input courbes; 
vardef fx(expr t) = 
 (1+cos(t))*cos(t) 
enddef; 
vardef fy(expr t) = 
 (1+cos(t))*sin(t) 
enddef; 
 
vues := 96;
for vue=1 upto vues:
beginfig(vue);
repere(14cm,14cm,7cm,7cm,3cm,3cm); 
 
% marque.unites(1mm); 
 
numeric t,u,r; 
t = (vue-1)/(vues-1)*2*Pi; 
 
% Tracé du cercle 
fill fullcircle 
 scaled 2unite 
 shifted origine 
 withpen pencircle scaled 1pt 
 withcolor 0.7white; 
 
draw fullcircle 
 scaled 2unite 
 shifted origine 
 withpen pencircle scaled 1pt 
 withcolor 0.3white; 
 
draw ftrace(0,2*Pi,100) en_place 
 withpen pencircle scaled 1.5pt 
 withcolor (0.95,0.95,0.9); 
 
pair A,P,Q,B,C,D,O; 
 
A = (cos(t),sin(t)); 
P = (cos(2*t),sin(2*t)); 
Q = (1,0); 
B = .5[P,Q]; 
C = B+A; 
D = B-A; 
O = (0,0); 
r = sqrt(2-2*cos(t)); 
 
draw fullcircle 
 scaled 2unite 
 shifted (B en_place) 
 withpen pencircle scaled 1pt 
 withcolor 0.5white; 
 
draw fullcircle 
 scaled (r*2*unite) 
 shifted (A en_place) 
 withpen pencircle scaled 1pt 
 withcolor 0.5white; 
 
 
% Tracé de la cardioide 
if vue=1: 
u = 0; 
elseif vue=vues: 
u = t; 
else: 
u = t-0.05; 
fi 
 
drawarrow ftrace(0,u,10+10*vue) en_place 
 withpen pencircle scaled 1.5pt 
 withcolor 0.2[blue,red]; 
 
draw (O--C) en_place; 
draw (O--D) en_place; 
draw (P--Q) en_place; 
draw (O--A) en_place; 
 
 
% Points 
draw A en_place withpen pencircle scaled 5pt withcolor blue; 
draw B en_place withpen pencircle scaled 5pt withcolor blue; 
draw C en_place withpen pencircle scaled 5pt withcolor blue; 
draw D en_place withpen pencircle scaled 5pt withcolor blue; 
draw P en_place withpen pencircle scaled 5pt withcolor blue; 
draw Q en_place withpen pencircle scaled 5pt withcolor blue; 
 
 
decoupe.repere; 
trace.axes(0.5pt); 
 
etiquette.axes; 
 
label(btex $A$ etex scaled 2,(1.15[O,A] en_place)); 
label(btex $B$ etex scaled 2,((B rotated 10) en_place)); 
label.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 3pt 
 withcolor 0.8white;
endfig;
endfor
 
end