最接近一组点的线 [英] Line closest to 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.
您可以看一下: http://www.alglib.net/interpolation/leastsquares.php
希望它会有所帮助。 :-)
Hope it helps. :-)
这篇关于最接近一组点的线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!