Intersection of two lines

356 Views Asked by At

What is the suggested method to find the intersection of two line *segments in 3D space programmatically?

I mean there are various methods to solve a set of 2 linear equations, eg. Using determinants, Matrices, the Add-Multiply-subtract-one-equation-from-another method (Sorry don't know what it's called).

Which one is best suited when using it on a machine/computer and why?

1

There are 1 best solutions below

0
On

The easiest to implement is projecting the lines onto 2D (most easily by dropping a common coordinate), finding their intersection point, and testing to see if the original lines share the point of intersection. The unprojected point can be recovered from the projection, since the slope of the line is known. Lines normal to the projection plane must be dealt with separately.