Mathematical Experiment 13

1            2

 Construct an animation displaying the various positions of the osculating
 circle of the following: the nephroid, the astroid, the deltoid and the cardioid.

 做法

 The main part is

  > k:=2;
  > x:=k*cos(t)-cos(k*t);
  > y:=k*sin(t)-sin(k*t);
  > p1:=plot([x,y,t=0..2*Pi],color=red,scaling=constrained,axes=none):
  > x1:=diff(x,t);
  > y1:=diff(y,t);
  > x2:=diff(x1,t);
  > y2:=diff(y1,t);
  > f:=(x1^2+y1^2)/(x1*y2-y1*x2+0.000001);
  > xc:=x-f*y1;
  > yc:=y+f*x1;
  > p2:=plot([xc,yc,t=0..2*Pi],color=blue,scaling=constrained,
                    axes=none):
  > r:=(x1^2+y1^2)^(3/2)/abs(x1*y2-y1*x2+0.000000001);
  > with(plots):
  > p3:=animate([xc+r*cos(s),yc+r*sin(s),s=0..2*Pi],t=0..2*Pi,
                          color=black,frames=50):
  > p4:=animate([(1-s)*x+s*xc,(1-s)*y+s*yc,s=0..1],t=0..2*Pi,
                          color=black,frames=50):
  > display(p1,p2,p3,p4);

 

 When k:=3 ------>

 

 

 

 

 

 When k:=-2 ------>

 

 

 

 

 

 

 When k:=-3 ------>