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?
I suppose you are trying to fit a curve/line, thus I would suggest least squares fitting for your case.
You can have a look at: http://www.alglib.net/interpolation/leastsquares.php
Hope it helps. :-)