I am planning on doing a space simulation program with full physics and as part of a hack to avoid too many issues with number precision I was going to switch orbiting objects to a calculated orbit (rather than rely on accurate gravity effects to keep it in perfect orbit). For this, I need to know if an object is in orbit at the moment and if it is, switch it across to using the formula in place of the less accurate application of gravity every frame.

How would I go about determining if an object is in orbit assuming I know its velocity, distance from centre of planet and the planet's mass.

Obviously I'm not looking for someone to do my work for me, but I have been unable to find any reading material online.

  • $\begingroup$ Not enough for an answer obviously, but you can search for things like "orbital capture" and use some results there to get ideas. But it's not as simple as a binary "in orbit," "not in orbit" situation. $\endgroup$
    – tpg2114
    Commented Nov 6, 2013 at 4:46
  • $\begingroup$ For a two body problem this is trivial (negative total energy when measuring potential as zero at infinite remove), but as soon as there are perturbations in the system it gets to be a lot less trivial. You would need to define what you mean by "in orbit" well enough to build a mathematical condition around it. $\endgroup$ Commented Nov 6, 2013 at 4:46
  • 1
    $\begingroup$ To clarify -- from a physics standpoint it's a bit clearer (when an object is captured vs not captured) but from a simulation standpoint it's actually harder. You might miss the capture event if you apply the wrong formulas, or you might end up spending so much effort checking that it would be cheaper to just use the full equation to begin with. But those details are off-topic $\endgroup$
    – tpg2114
    Commented Nov 6, 2013 at 4:47
  • 2
    $\begingroup$ @gregsan That prescription is equivalent to the energy condition I suggested above and it can fail when there are more than two bodies in the system; worse the whole project is only interesting if there are more than two bodies in the system, $\endgroup$ Commented Nov 6, 2013 at 5:49
  • 1
    $\begingroup$ @MrUniverse, If you want to plot a perfect trajectory of an object under influence of multiple massive bodies, you'll have to solve the kinematical equations using newtonian gravity, which is possible(I think) but tough and no general solution usually exists. So you will have to compute the trajectory for every case separately. $\endgroup$
    – udiboy1209
    Commented Nov 7, 2013 at 17:08

1 Answer 1


I believe the concept you're probably looking for is the gravitational effective potential. For cases where the mass of one of a pair of orbiting bodies is much larger than the other (i.e., M >> m) or where the problem has been reduced to an "equivalent one-body problem" through the use of the reduced mass, the smaller mass (or the only mass, in the equivalent one-body problem) will become "trapped" in a fixed orbit if its total energy $E$ satisfies the criterion $E < 0$. (The wikipedia page actually claims here that the condition for a trapped orbit is $U_{eff} < E$ but this appears to differ from what I've seen printed in classical mechanics textbooks, so check your sources carefully!). At any rate, the utility of the effective potential from your perspective is that whenever the conditions for a gravitationally bound orbit are met, it gives you a simple mechanism for calculating the aspides of the orbit. Once you have the apsides (i.e., the detailed shape and eccentricity of the elliptical orbit) you should be able to use concepts such as Kepler's Laws to help you work out the specific time evolution of each individual orbit.

The mathematical expression for effective potential is usually derived within the context of the larger topic of central force motion. If the wikipedia page on effective potential doesn't provide enough explanation for you to be able to figure out how to plug in real numbers and correctly perform a practical calculation, then I'd recommend that you step back and try to understand it within the context of the larger problem of central force motion. Your choices for doing this include an online open course, or alternatively, many of the more commonly used classical mechanics text books will usually have a chapter about it; "Classical Dynamics of Particles and Systems" by Stephen T. Thornton and Jerry B. Marion, for example, has a pretty good discussion. Or just google "Central Force Motion" and see what else comes up.

BTW, the truly "full physics"and most generic version of the space simulation program that you're working on is customarily described as the gravitational N-body problem, and a lot of people in the astronomy and space community have already developed their own solutions. Some have even written textbooks about how they did it; e.g., "Gravitational N-body Simulations, Tools and Algorithms", by Sverre J. Aarseth. Since the full physics problem you're attempting to solve is inherently complicated and difficult, you may wish to consider acquiring one of them.

  • $\begingroup$ Great answer. Unfortunately due to the fact that entering the orbit of one object near a satellite will have extra factors, I don't know if I am approaching the problem correctly. I will further research the N-Body problem as well as the rest. Thanks for the help! $\endgroup$
    – Sellorio
    Commented Nov 12, 2013 at 1:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.