>
|
use plots, plottools in
module()
local R,X1,Y1,X2,Y2,P,P1,P2,G,H,a1,a2;
P1 := plot([2,2*(1+cos(theta))], theta = 0 .. 2*Pi, coords = polar,color=black,tickmarks=[3,3]):
P2 := textplot({[-1.3,1.2,typeset(r[1])],[3.3,2.2,typeset(r[2])]});
P:=display(P1,P2,scaling=constrained);
R := 2*(1+cos(t)):
X1 := t->2*cos(t):
Y1 := t->2*sin(t):
X2 := unapply(R*cos(t), t):
Y2 := unapply(R*sin(t), t):
G:=proc(t)
display(polygon([[X1(t),Y1(t)],[X2(t),Y2(t)],[X2(t+.1),Y2(t+.1)],[X1(t+.1),Y1(t+.1)]],color=red));
end:
H:=proc(t)
plot([[[0,0],[X1(t),Y1(t)]],[[0,0],[X1(t+.1),Y1(t+.1)]]],style=line, linestyle=dot,color=black):
end:
a1:=animate(G,[theta],theta=-Pi/2..Pi/2-.1,background=P,frames=62);
a2:=animate(H,[theta],theta=-Pi/2..Pi/2-.1,frames=62);
print(display(a1,a2));
end module;
end use:
|