Optimal search for opposing unit vectors

44 Views Asked by At

Given a finite set of 3D unit vectors, what is the optimal way to discover whether any pairs from that set point in opposite directions, i.e. have a negative dot product. In $O(n^2)$ time, we can compare every such pair, but I am sure we can do better than that.