Moving Object(s) Simulation

Hello all,

I started C++ programming a while back and quickly became unstuck after attempting my third, 'simple' program.

I am trying to simulate the path of three, interdependently moving masses through Cartesian space ((x,y) space if I'm not mistaken). Each point mass exerts a gravitational force on each of the others and is assigned with an initial velocity (speed and bearing). The desired result would be a text file containing the following information for each mass:

'(x,y) coordinates', 'speed', 'bearing' and 'elapsed time'

In a previous simulation, I was able to simulate one falling mass under the influence of another (which was fixed) by iterating the elapsed time value and reading off the previous iteration's values of speed and bearing. However, I was using fairly simple mathematics and when I tried to apply the same formulas to the new problem it felt like trying to smash a square block into a triangular hole.

Is anyone aware of the sort of mathematics needed for such a simulation? I've been pointed towards 'vector calculus' before but I'm not familiar with it - can anyone point me in the right direction?

Cheers!