/* We’ll stop the drawing after the radius is over 100
pixels. We still continue to rotate the container. */ if (radius > 100) { speed = 0; container.rotation += 10; } else { //Increase the radius in each frame radius += 0.5;
//New x and y coordinates xpos = Math.cos(angle) * radius; ypos = Math.sin(angle) * radius;