Math
Quadtree: space that indexes itself
Inspect adaptive quadtree partitions, nearest-neighbour pruning and collision candidates in static or moving point clouds.

Try this
Click inside the square to query the nearest point. Green cells were visited; bounding-box distances prune the others. Red links join overlapping equal-radius discs found by the tree. Moving points rebuild the index at 20 Hz.
Equations used in the module
Equations Subdivide a crowded square into four children Nearest search prunes a node when distance(query, box)² > best distance² Disc pairs satisfy |xi−xj| ≤ 2r Depth is capped at 8 to handle coincident points


