## Solving Linear Geometry for a 'projected intersection'

Working on another problem here with varying results. I have three line segments in 3D and am looking to find what would be a projected intersection between two. This projected intersection is defined by a ray that is perpendicular to the axis a and passes through both segments f and s.

f and s do not necessarily intersect, nor do either f and s with a. But there are occasions where the ray satisfies the perpendicular to the axis requirement, as well as passes through both f and s.

The ray does not need to be perpendicular to f and s.

I've gotten to a point where I have three linear equations with respect to line parameters t,u and v. But I haven't been able to correctly solve for the three values using Guassian Elimination.

Just wondering if this is the best (or even correct) way to go about it or is there an easier (simpler?) method.

Thanks the for help.
Attached Thumbnails

 Hey athuss and welcome to the forums. One suggestion I have is that since f and s don't necessarily intersect, what you could do is turn this into an optimization problem where give a parameterization of both f and s for some parameter t and u (for f and s respectively) and maintaining that you have boundaries for the t and u variables (since they are rays and not lines), you find the situation where ||f-s|| is minimized. If you get a zero distance, then it means that they intersect but otherwise, you get the point of intersection at the perpendicular distance because in normal cartesian geometry, things are minimized when they are perpendicular to one another. Once you have this then you do another minimization problem to find the minimal distance between the point you obtained above, and the line segment corresponding to the vector a (you can also treat a as a ray by restriction the domain of the parameterization). The idea behind this is that the minimal distance corresponds to a perpendicular distance. So once you have the point on a and the point for (f,s) rays (even if they don't intersect), then you have all the information required. In terms of how to do the optimization, use the norm equation to be ||f-s||^2 = and take it from there (where you have f and s in terms of t and u and some restriction on t and u). Have you done optimization before at any level?