Barnes-Hut Algorithm

// QUADRANT FIELD VISUALIZER v2.0.0
SYS ONLINE 00:00:00 STARDATE 2026.066

If you have any feedback or requests, please send an email to

☕ BUY ME A COFFEE
CHANGE LOG
v2.0.0
  • Real Barnes-Hut N-body gravitational physics simulation — bodies now move!
  • Quadtree rebuilt every frame; partition lines update live during simulation
  • Bodies have mass, velocity (VX/VY), and speed computed each step
  • Hover tooltips on field bodies show TYPE, X, Y, MASS, VX, VY, SPEED
  • Hover tooltips on quadtree nodes show DEPTH, BODIES, MASS, COM, REGION
  • Added Physics Guide section explaining all simulation properties
  • START button now toggles simulation on/off
v1.0.3
  • Collapsible sections in side panel and mobile drawer
  • Added About section to mobile view
  • Uniform width for control buttons in side panel
v1.0.2
  • Improved touch interactions on mobile devices
  • Various bug fixes and stability improvements
v1.0.1
  • Improved mobile responsiveness
  • Added Add and Remove buttons for bodies
v1.0.0
  • Initial release of Barnes-Hut Algorithm Visualiser
(0,0) (1,0) (0,1) (1,1)
QUADTREE STRUCTURE
DEPTH 0
DEPTH 1
DEPTH 2+
EMPTY
BODY LEAF
NO TREE DATA
RUN THE FIELD SCAN FIRST
SWITCH TO FIELD VIEW → PRESS START

The Barnes-Hut algorithm is an N-body simulation method that uses quadtree spatial partitioning to approximate gravitational forces in O(n log n) time. This interactive visualizer lets you run gravitational simulations and inspect the quadtree structure in real time.

θ = 0.5
OPENING ANGLE
SPEED
BODIES8
NODES0
DEPTH0
SPLITS0