This simulator uses the Barnes-Hut algorithm to simulate gravity on n bodies with logarithmic complexity!
To see the n-body simulator in motion, visit https://kelvin-chen.github.io/N-Body-Simulator/!
Mouse click
- insert particle at mouse click locationSpacebar
- pause/unpause simulator (default paused)[
and]
- slow down and speed up the simulatort
- view the Barnes-Hut quad treer
- reset simulator- You can also generate some interesting default patterns with the particles:
s
- squareS
- spiralc
- circlee
- ellipse