This is a simulation of three-body problem with a plot.
m2m1 and a radius r1m1:
Mass of each big object.
r1:
Radius of each big object (in pixels).
m2:
Mass of each small object (pixel).
G:
Gravitational constant (big G).
Drag:
Drag factor applied each timestep (1 = no drag).
dT:
Time step for the simulation. Increase for speed , decrease for accuracy.
Too much dT creates ripple artifacts. The time taken to converge decreases linearly when this increases.
Recommended is 10 normally, 20 for faster simulations and 1-5 for accuracy.
canvasSize:
Size of the canvas in pixels (canvas is square). The time taken increases cubicly with this parameter.
Make big objects/attractors attract each other as well as the particles. The particles don't attract other particles or the big objects.