How to predict orbit based on time?

How can I predict a spaceship’s orbit, as the player adjusts the velocity. Let’s say the spaceship is in a circular orbit. How do I predict the future XYZ coordinates for that and also for elliptical orbits. Say the player fires the engines to boost the speed. How do I continuously update the orbit?

I can find tons of formulas on Kepler’s and Newton’s laws but none of them are for the future XYZ positions.

I know Kerbal Space Program predicts trajectories using a function of time but they don’t say the formulas they use.

Hi,

I have just completed a blog post on this topic: Planetary Orbits in Javascript | N-body Physics

It explains how to use the Kepler equations and provides sample Javascript code.

If you want an “out of the box” solution, you can take a look at my new asset “Gravity Engine” in the asset store: Unity Asset Store - The Best Assets for Game Making

PM