I modified the code: you can change the density,too!
And it will display gravitation field.
If you need the force, just multiple the gravitation field by mass of the object.