Finding the point of intersection for two 2D line segment is easy; the formula is straight forward. But finding the point of intersection for two 3D line segment is not, I afraid.
What is the algorithm, in C# preferably that finds the point of intersection of two 3D line segments?
I found a C++ implementation here. But I don't trust the solution because it makes preference of a certain plane ( look at the way perp
is implemented under the implementation section, it assumes a preference for z plane
. Any generic algorithm must not assume any plane orientation or preference).
Is there a better solution?