I have two sets of line segments, A and B. My goal is, for each segment in A, I want to find all segments in B which approach within some threshold distance.
Clearly this can be done in O(n^2) easily enough, but I think it's possible to do better. For instance, if I were working with points...