Question: problem with animation

On donne un cercle fixe de diamètre AB, un point M variable sur ce cercle et on construit un carré de sens direct AMNP; Trouver les lieux des points N et P.
restart;
with(plots);
r := 1;
A := [-r, 0];
B := [r, 0];
M := [r*cos(theta), r*sin(theta)];
N := [r*cos(theta) - r*sin(theta), r*sin(theta) + r*cos(theta)];
P := [-r*cos(theta) - r*sin(theta), r*cos(theta) - r*sin(theta)];
c1 := `~`[plottools]*circle([0, 0], r, color = blue);
plot1 := plot(c1, color = blue);
plot2 := animate([N[1], N[2], theta = 0 .. 2*Pi], color = red, thickness = 2);
plot3 := animate([P[1], P[2], theta = 0 .. 2*Pi], color = green, thickness = 2);
display(plot1, plot2, plot3);
Would you like to improve this code so it works. Thank you.
 

Please Wait...