Well, here's how you create points along an ellipse:
for degree in range(360): x = cos(degree * 2 * pi / 360) * radius * xToYratio y = sin(degree * 2 * pi / 360) * radius
(x,y) will follow the ellipse centered at (0,0) , with radius y equal to radius and radius x xToYratio . In your case, you probably want the degree somehow related to time.
EDIT: you can also do this:
for degree in range(360): x = cos(degree * 2 * pi / 360) * xRadius y = sin(degree * 2 * pi / 360) * yRadius
where xRadius is half your rectangular width and yRadius is half the height of your rectangle. Visualize it intuitively - you have a circle and you stretch it (i.e., scale it, i.e., multiply it) so that it is larger than the horizontal and vertical rectangle.
source share