Untitled (2)

>    restart;

>    with(plots);

Warning, the name changecoords has been redefined

[Interactive, animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, cylinderplot, densityplot, d...
[Interactive, animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, cylinderplot, densityplot, d...
[Interactive, animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, cylinderplot, densityplot, d...
[Interactive, animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, cylinderplot, densityplot, d...
[Interactive, animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, cylinderplot, densityplot, d...

>    n:=3;

n := 3

>    x:=cos(n*t)-n*cos(t);y:=sin(n*t)-n*sin(t);

x := cos(3*t)-3*cos(t)

y := sin(3*t)-3*sin(t)

>    x1:=diff(x,t);y1:=diff(y,t);

x1 := -3*sin(3*t)+3*sin(t)

y1 := 3*cos(3*t)-3*cos(t)

>    x2:=diff(x1,t);y2:=diff(y1,t);

x2 := -9*cos(3*t)+3*cos(t)

y2 := -9*sin(3*t)+3*sin(t)

>    w:=x1*y2-x2*y1;

w := (-3*sin(3*t)+3*sin(t))*(-9*sin(3*t)+3*sin(t))-(-9*cos(3*t)+3*cos(t))*(3*cos(3*t)-3*cos(t))

>    r:=(x1^2+y1^2)^(3/2)/abs(w);

r := ((-3*sin(3*t)+3*sin(t))^2+(3*cos(3*t)-3*cos(t))^2)^(3/2)/abs((-3*sin(3*t)+3*sin(t))*(-9*sin(3*t)+3*sin(t))-(-9*cos(3*t)+3*cos(t))*(3*cos(3*t)-3*cos(t)))

>    xc:=x-(x1^2+y1^2)/w*y1;yc:=y+(x1^2+y1^2)/w*x1;

xc := cos(3*t)-3*cos(t)-((-3*sin(3*t)+3*sin(t))^2+(3*cos(3*t)-3*cos(t))^2)/((-3*sin(3*t)+3*sin(t))*(-9*sin(3*t)+3*sin(t))-(-9*cos(3*t)+3*cos(t))*(3*cos(3*t)-3*cos(t)))*(3*cos(3*t)-3*cos(t))

yc := sin(3*t)-3*sin(t)+((-3*sin(3*t)+3*sin(t))^2+(3*cos(3*t)-3*cos(t))^2)/((-3*sin(3*t)+3*sin(t))*(-9*sin(3*t)+3*sin(t))-(-9*cos(3*t)+3*cos(t))*(3*cos(3*t)-3*cos(t)))*(-3*sin(3*t)+3*sin(t))

>    p1:=plot([x,y,t=0..2*Pi],scaling=constrained):

>    p2:=animate([xc+r*cos(s),yc+r*sin(s),s=0..2*Pi],t=0..2*Pi,scaling=constrained,frames=100,color=blue):

>    p3:=animate([(1-s)*xc+s*x,(1-s)*yc+s*y,s=0..1],t=0..2*Pi,scaling=constrained,frames=100,color=green):

>    p4:=plot([xc,yc,t=0..2*Pi],scaling=constrained,color=COLOR(RGB,0.2,0.3,0.5)):

>    display(p1,p2,p3,p4,axes=none,thickness=3);

[Maple Plot]

>