Equation / formula to determine an objects position on an ellipitcal path
- by David Murphy
I'm making a space game, as such I need objects to follow an elliptical path (orbit).
I've worked out how to calculate all the important aspects of my orbits, the only remaining thing is how to have an object follow it.
My Orbit class contains the major, minor (and by extension semi-major,semi-minor) lengths. The focii radius, area and circumference even.
What is the equation to determine an objects x/y position (only need 2D) on an ellipse with a certain speed after a period of time. Basically, every frame I want to update the position based on the amount of elapsed time.
I would like to have the speed along the path speed up and slow down according to the distance from the object it's orbiting, but not sure how to factor this in to the above given that at any point in time the speed has changed from it's previous speed.
EDIT I can't answer my own question. But I found the question and answer is already on stackexchange:
Kepler orbit : get position on the orbit over time