Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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?

share|improve this question
You might find this helpful The Algorithm to Find the Point of Intersection of Two 3D Line Segment on SO. Regards –  Amzoti Jan 14 '13 at 21:05
The 'add-subtract-multiply' method of manipulating the rows (or columns, depending on your problem) of a matrix is known as Gaussian Elimination. –  A Blumenthal May 2 '13 at 3:13
@boywholived: What is you claimed is completely false. Gaussian elimination can be programmed in any common programming language easily. –  user21820 Aug 16 '14 at 5:45
@boywholived: If you do not know what is Gaussian elimination or how to write a computer program, please read up on it before blindly disagreeing with what I said. –  user21820 Aug 16 '14 at 5:58

1 Answer 1

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.