Physicists Discover a Whopping 13 New Solutions to Three-Body Problem
news.sciencemag.org
news.sciencemag.org
Additionally, all the near misses makes it difficult to calculate the orbits, even with variable step size.
PS: Some of the configurations are not stable with my code. I'll try Runge-Kutta.
You might want to try Stormer-Cowell, it's sort of a gold standard in orbit simulation.
UPDATED: Hmm, now that I think of it, this would probably profit more from a variable step method. Some of the close approaches seem to be really close for a fixed-step integrator.
I'll try both if I find the time :)
Good times.
I really like you simulation.
https://en.wikipedia.org/wiki/Bulirsch%E2%80%93Stoer_algorit...
It doesn't work, though. On firefox 19.0.2 (archlinux), it seems to detect clicks shifted a good bit to the right (maybe 100 pixels?), and a little bit down. It looks like it's using whole-screen coordinates without correcting for the position of the canvas.
It would also be cool if you could give some quantitative data below - the total amount of kinetic/potential energy would be fun to watch, for instance. (And graph it.)
You also seem to be using an inverse-square law, which is "incorrect" in a 2D universe, but I suppose it makes it seem more natural.