Particle collision detection using quadtree. A quadtree is a tree data structure in which each internal node has exactly four children.
Quadtrees are the two-dimensional analog of octrees and are most often used to partition a two-dimensional space by recursively subdividing it into four quadrants or regions.
Check demo on GitHub page: https://s-litvin.github.io/quadtree/