Implementing Hoey Shamos algorithm with C#

First, regarding the line intersection: you do not need the actual point of intersection, only to know if they intersect. See for an algorithm that does just that. About the List implementation: In your implementation using Lists, you call indexOf on the sweepline to find nl. This searches the sweepline from start to end. … Read more

Given n points on a 2D plane, find the maximum number of points that lie on the same straight line

BTW complexity is indeed O(n^3) to lower that you need to: sort the points somehow by x and or y in ascending or descending order. Also use of polar coordinates can help sometimes use divide at impera (divide and conquer) algorithms usually for planar geometry algorithms is good idea to divide area to quadrants and … Read more

What is the fastest algorithm to calculate the minimum distance between two sets of points?

Perhaps you should check out (PDF warning! Also note that, for some reason, the order of the pages is reversed) “Optimal Algorithms for Computing the Minimum Distance Between Two Finite Planar Sets” by Toussaint and Bhattacharya: It is shown in this paper that the minimum distance between two finite planar sets if [sic] n points … Read more