Given a set of points
S (x, y)
.
Find the line
whose distance from all the points is minimum ?
That is, minimize the sum of distances (in absolute value or squared) between each point and the optimal line.
By distance I mean the shortest distance between the point and the line. That is, the most common one, the euclidean distance in euclidean space.
I tried googling but could not find any relevant results, is there any line sweep algorithm that can do the task?