2 ms·
First sort by one axis, then take the items that are close enough and sort them by another axis, then take the ones that are close enough and do the expensive s
by z3t4 6y ago
First sort by one axis, then take the items that are close enough and sort them by another axis, then take the ones that are close enough and do the expensive square root or intersect calculations which are much slower then sorting.