Find a point that minimizes the distance from the set of N lines

Given several (N) lines in three-dimensional space, find a point that minimizes the distance to all lines.

  • Given that the shortest distance between the line [aX + b] and the point [P] will be on the perpendicular line [aX + b] - [P], I can express the minimum square distance as the sum of the square of the distance, for example. ([aX + b] - [P]) ^ 2 + ... + ([aX + b] n- [P]) ^ 2.
  • Since the strings are perpendicular, I can use the Dot Product to express [P] in terms of the line

I examined the use of least squares to estimate a point that minimizes distance, the problem is that the standard least squares will approximate the best suitable line / curve given by the set of points. What I need is the opposite, given a set of lines evaluate the best fitting point.

How to approach this?

+4
source share
4 answers

wikipedia , a'x + b = 0 p (a'p+b)^2 / (a'a). , , , . :

  • a ax+b=0
  • -b ax+b=0
  • 1/(a'a) ax+b=0

.

+3

:

  • ,
  • N
  • , ( , ..).

, N . , ( , .)

, , - , . # 1, ( " " ).

+1

- : -

F(x,y) = sum((y-mix-ci)^2/(1+mi^2))

:

dF(x,y)/dx = sum(2*(y-mix-ci)*mi/(1+mi^2))

dF(x,y)/dy = sum(2*(y-mix-ci)/(1+mi^2))

To Minimize F(x,y) :-

dF(x,y)/dy = dF(x,y)/dx = 0

Gradient Descent, ,

0

, . 26 step ( ). , , 2, . , .

0

Source: https://habr.com/ru/post/1548312/


All Articles