# Find the equivalent intersection point of multi lines in 3D space

1. Nov 23, 2007

### zyh

Find the equivalent intersection point of multi lines in 3D space.
HI everyone, I'm not a native english speaker, so I wonder you could
understand my question very well.

This question originates from my physics experiments. When I catch
several lights from my equipment, the light source is far away, so I
should caculate the position of the equivalent "light source". This
comes the post title. Normally, all these light lines were skew each
other.

For two lines, this is very simple to get the answer, because we can
easily define the equivalent point as the mid-point of the shortest
distance of the two lines. Several algorthms can be found by Google.

For more then two lines, How can I do?

I have dig into some math stuff about linear algebra or algebra
geometry. Each lines can be constrined by two equations of plans.like
Ax+By+Cz=D. so, as n lines, we can get 2*n equations. Now, I wonder
the best root of these equations. Normally, the least square method
could be used, but I don't think this could applied to my case. The
criterion is different, maybe, I want to find the point that the sum
of distance to those lines are minimun.

But this make the prolems get more complex to solve. Does anybody
coulde give me some ideas to solve this? All what I want to is to get
the equivalent point. I'd appreciate your reply! THANKS!

2. Nov 24, 2007

### uart

I'm not quite sure what question you are asking? Are you saying that you know how to solve for the "equivalent point" which minimizes the mean squared distance but now you want to change the criteria and minimize the mean absolute distance (MAD) instead.

If that's what you're asking then I'd say you need to further consider if that is what you really want. Take for example the two line case where you seem fairly certain that taking the mid-point of the "shortest distance of the two lines" is the correct thing to do. But this is minimizing the mean squared distance! If you were minimizing the MAD then you could take any point on that "shortest distance" line segment and they'ed all be equivalent (in terms of MAD). So based on what you've told us I think you should stick with LMS unless you have some compelling reason that you haven't yet disclosed.

Last edited: Nov 24, 2007
3. Nov 24, 2007

### Chris Hillman

Request clarification

Hi, zyh, if you can upload (see "manage attachments" when you reply) a sketch of the geometry you have in mind, I think that would greatly clarify the question. For example, whether we should expect your problem to be subject to numerical instabilities in the (presumed) underlying linear algebraic computations.

If I understand you correctly, you have three or more mutually skew lines, whose equations you know, and you wish to find a point which minimizes the sum of the least distance to each of these lines. If I understand correctly, the n lines are something like measured light paths from n repetitions of an experiment and you wish to use this data to estimate the position of the common source, which is taken to be static.

But I don't understand why least squares (minimize the sum of the squared least distance to each line) is unsatisfactory, and I note that while there is a notion of a "vector median" for example, this is much trickier to work with (not unique, not always defined even nonuniquely, and other awkwardness). Similarly, sums of squared distances are much easier to work with than sums of distances, as uart noted.

BTW, "geometrical statistics" (e.g. "circular statistics", "spherical statistics") is notoriously tricky. Particularly if you want to explore something nonstandard, I'd recommend testing your proposed statistical procedure on "randomly constructed test data". Even this is tricky; see for example Mezzadri, "How to Generate Random Matrices from the Classical Compact Groups", Notices of the AMS 54 (2007): 592-604 for generating "random directions" by rotating a fixed direction by a random rotation matrix. But while complications are usually unwanted, they are unavoidable, and fortunately this is some nifty mathematics lurking here, so I encourage anyone curious to follow up by reading that excellent article, which I think should be read by pretty much all working scientists!

Last edited: Nov 24, 2007
4. Nov 25, 2007

### zyh

I add a picture to represent my mind

Thanks to Chris Hillman and uart.
the image upload is here:
https://www.physicsforums.com/attachment.php?attachmentid=11692&stc=1&d=1195972054" (by the way, how to show the uploaed image file here? the file is *.jpg??^_^)
you are right. In my experiment, I have get several lines(with red color in picture), they are rays come from the common light source center. so I want to estimate the common source by elongating these lines(see green lines). What I want is to caculate the position accurately, so I should do some minimization.

I define the criterion the sum of square distance is minimum.But I can't find the method to solve it. I am also wandering the "Least square method"（LSM） could apply to this case. I know the LSM can only be applied to the linear equations like $$Ax=b$$,and we should minimize the square error sum$$\|Ax-b\|$$, But I think this error sum is different from the "square distance sum" I mentioned earlier.

Now, I have found one solution :
define the Point x0=[x,y,z]' then caculate the square distance to the line by equation from:http://mathworld.wolfram.com/Point-LineDistance3-Dimensional.html" [Broken]
the line define by two points x1 and x2,
$$d^2=\frac{[(x_2-x_1)\times(x_1-x_0)]^2}{|x_2-x_1|^2}$$
so I can get the objective function like $$sum=ax^2+by^2+cz^2+dxy+ezx+fyz+h$$, this function maybe is differentiable, then I can get the optimize solution x0.

My question:
the steps above is the application of LSM？
And if there is a more convient method using Linear Algebra to solve this?
I'm confused about the LSM.

Thank you again!

#### Attached Files:

• ###### intersect.jpg
File size:
9.8 KB
Views:
231
Last edited by a moderator: May 3, 2017