title: The algorithm to find the point of intersection of two 3D line segment
body: <p>Finding the point of intersection for two 2D line segments is easy; <a href="http://local.wasp.uwa.edu.au/%7Epbourke/geometry/lineline2d/" rel="nofollow noreferrer">the formula is straight forward</a>. But finding the point of intersection for two 3D line segments is not, I afraid.</p>
  <p>What is the algorithm, in C# preferably that finds the point of intersection of two 3D line segments?</p>
  <p>I found a <a href="http://www.softsurfer.com/Archive/algorithm_0104/algorithm_0104B.htm" rel="nofollow noreferrer">C++ implementation here</a>. But I don't trust the solution because it makes preference of a certain plane (look at the way <code>perp</code> is implemented under the implementation section, it assumes a preference for <code>z plane</code>. Any generic algorithm must not assume any plane orientation or preference).</p>
  <p>Is there a better solution?</p>