Circular(Oval) Object Path

Hello, I was just wondering how I could move an object around an oval shaped path such as the attached image. As well as an adjustable speed. I’m trying to learn some new things but can’t seem to find anywhere on how to do this.

Thanks a lot in advance!

I think they keyword you are looking for is ellipse. I found a couple of decent answers on google.

Basically it comes down to the formulas

x = a cos(time * speed);
y = b sin(time * speed);

where a and b are the ellipses radii on the x and y dimensions.

1 Like

the problem is: the movement speed is slower on the closer areas (in the picture at the top and bottom) because the formula actually moves on a stretched or shrinked circle…

A long time ago I tried to find a solution for this problem but I couldn’t…

1 Like

You’re looking for (incomplete) elliptic integrals.
But be warned: this is quite complex stuff. :wink:

1 Like

Hmm… looks like a very interesting article.
Just scrolled quickly through… not sure if it is able to keep the speed constant…

However, I remembered how I solved the problem back then…
I converted the ellipse into a polygon and used that approached shape for movement…

1 Like

If I remember right… ( no guarantees there !)
The speed of an object in elliptic orbit. The area covered by a line from the gravitational centre to the orbiter are a constant over time. In games we can often cheat a bit, and in this case might make the speed proportional the inverse of the current distance from the gravitational centre to the orbiter.