gravitational attraction simulation

This is an application that I made to simulate the gravitational attraction between two objects in space using Newton’s law of universal gravitation (FG=(GMm)/R2). The two objects have different masses, the red object has ten times the mass of the green object. The objects bounce off of the edges of the screen and can be dragged around.

I have found it surprisingly hard to put the green object in orbit around the red one, without it passing through it, especially since the red object moves toward the green one ever so slightly due to the small difference in masses.
(press escape to exit the application)
download for windows (64 bit)

gravitational attraction gravity space objects