I have a number of 2D line segments that should all intersect at one point but don’t because of noise earlier in the calculations that cannot be reduced.
Is there an algorithm to compute the best approximation to the intersection of all the line segments. Something like the point with the minimum average distance to all the line segments that doesn’t necessarily lie on any of the segments?
If we have freedom to select a metric, sum of squared distances may give a simple algorithm.
We can represent square of distance to a line #i as function of point coordinates, we will get
(A[i]x,x)+(b[i],x)+c[i],A[i]is a matrix 3×3,b[i]– vector,c[i]– number, (a,b) – scalar multiplication.Their sum will be
(A[sum]x,x)+(b[sum],x)+c[sum].Minimum of such function is
x=-inverse(A[sum])b[sum]/2.