## Two View Triangulation of 3D Skew Lines

Assume that we have parametric lines $L_0$ and $L_1$, the challenge is to find the points $s_0$ and $s_1$ of closest approach. First, we must test the assumption that our lines are skew, meaining they are not parallel and do not intersect. To frame this, we take the forms of $L_0$ and $L_1$ and simplify them by thinking of them as parametic vectors where $C_0$ and $C_1$, represent the camera position vectors and $v_0$ and $v_1$ represent the vector was previously calculated from the subtraction of match coordinates with the camera vector. We make the simple equations:

To make sure that the lines are not parallel, which is unlikely, we must verify that their cross product is not zero. if $v_0 \times v_1 = 0$ then we have a degenerate case with infinitely many solutions. As long as we know this is not the case we can proceed. We know that the cross product of the two vectors $c = v_0 \times v_1$ is perpendicular to the lines $L_0$ and $L_1$. We know that the plane $P$, formed by the translation of $L1$ along $c$, contains $C_1$. We also know that the point $C_1$ is perpendicular to the vector $n_0 = v_1 \times (v_0 \times v_1)$. Thus, the intersection of $L_0$ with $P$ is also the point, $s_0$, that is nearest to $L_1$, given by the equation:

This also holds for the second line $L_1$, the point $s_1$, and vector $n_1 = v_0 \times (v_1 \times v_0)$. with the equation:

Now, given to points that represent the closest points of approach, we simply find the midpoint $m$:

This is copied from a section of my thesis. If you found this useful to your research please consider using the following bibtex: