Say I have an arbitrary number of bodies with x and y coordinates, each with a unique mass. How would you calculate the change in velocity for each body? How do you calculate inertia?
Mainly I just need the formulas, but if anyone is kind enough and has the time to do it, a java example would be awesome.
This brings back a flashback. I once had to calculate the trajectory of an asteroid through the solar system for an astrophysics course. I still have the (crappy) java code. If you are interested, PM me. Unfortunately, the accompanying report is not in English.
There are no analytical solutions for more than 2 bodies. For three bodies, you can approximate it if the mass of the third body can be neglected. For example, the apollo on way to the moon. For a larger number of bodies, you have to compute a numerical solution.
If you are only interested in a bunch of things falling towards the ground, with no or little interaction between them, then you simply use an acceleration of 1 g for each object. This also assumes that you are close enough to the earth surfaces. The value of g also depends where you are on the planet. G, as in Newton's law of gravity, is a universal constant. g as in F=mg is not.
If you really want to get started in numerical computations of the heavens, then maybe this book is of interest to you (it is in English):
http://www.amazon.com/Astronomical-...=sr_1_1?ie=UTF8&s=books&qid=1261345244&sr=8-1
(Ah, another half-hearted project that fell through the cracks.)
You should be forewarned though. I don't think you are embarking on an easy task. Implementing a few formulas from a book is one thing (setting aside all the numerical approximations issues), trying to build a physics engine is another. If you do not know both physics and mathematics, then I recommend you find a good API. You might get some answer eventually if you do it yourself, but that doesn't mean it will be physically correct.
If you are just doing it for fun, though, then go ahead. Just don't expect too much, too early. You could get disappointed very soon.