generic quadtree for fast neighbor lookup in two dimensions