Home▸Algorithms & AI▸Quadtree Spatial Subdivision (2D)

🌳 Quadtree Spatial Subdivision (2D)

Interactive 2D quadtree: watch recursive four-way subdivision as points are added, drag a range-query rectangle, and compare quadtree node visits against a brute-force linear scan.

Algorithms & AI2DEasy60 FPS📱 Mobile-adapted⇄ 3D version
2d-quadtree ↗ Open standalone
⚙ Under the hood

Watch a quadtree recursively split a 2D plane into four child cells whenever a node's point count exceeds a capacity threshold. Add points by clicking or scatter them randomly, then drag a query rectangle to see how many quadtree nodes are visited versus a brute-force scan of every point.

quadtreespatial data structurerange queryrecursive subdivisionalgorithmscanvas2d

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)