This is amazing! Nicely done!

I did something similar, mostly 2D here:

https://www.nhatcher.com/three-body-periodic/

(Mine is just unfinished)

Thank you! Your 2D version is great, I love seeing how different people approach this stuff. As for integrators, I currently only have Velocity Verlet and RK4 (can change in the advanced settings). I started with just Verlet, but to get some of the presets to behave properly I ended up needing RK4 as well. I’ve been thinking about adding adaptive methods next, but I'll take a look at the methods you've got listed too. Everything is still running in plain JS for now. I started moving some of the work into web workers but haven’t finished that part yet.

Symplectic integrators are the approach I used for some old galaxy simulations. Page 5 on the attached paper was my main reference, eq 22 https://arxiv.org/pdf/cond-mat/0110585 I believe this is used in several academic codes for long term N-body calculations.

I would be very curious to compare notes on the integrators you used. How good do they perform in general?

In the avobed shared you can go to the settings a pick an integrator. I did the integrators in wasm although I suspect js is just as fast.

Color me impressed! I love the ammount of settings you can play with. I still need to understand what happens whe yu add more bodies though.

what the heck? are those three orbits genuinely symmetrical in 2D or did I misinterpret

I'm not sure which ones are you talking about specifically. But there are some with some heavy symmettrical patterns indeed. To my eyes some are mesmerizing to watch.

The orbits are computed in real time, so yeah what you are seeing (modulo errors in my code is genuine)

There are some caveats though. Some orbits are periodic only in a rotating frame of reference.

EDIT: you can share the URL and I can see which orbits you are talking about

Like: https://www.nhatcher.com/three-body-periodic/?class=bhh_sate...