General Formula for Where Shortest Distance Between 2 Skew Lines Intersects

622 Views Asked by At

I am well familiar with how to find the shortest distance between 2 skew lines in 3 dimensional space. I have developed a generalised formula to find the shortest distance between two lines, yet cannot generate a general formula to provide the two points where the vector between them of shortest distance intersects the lines themselves (ie the point on each line closest to each other). My knowledge of vectors is somewhat limited so if anyone does have a solution, could they please try to keep it as simple as possible.

EDIT: It would be greatly appreciated if someone could provide a full solution as I have scoured resources which hint at what to do but I keep getting myself stuck when I continue the process.

3

There are 3 best solutions below

0
On

Parametrize the lines as \begin{align*} \vec{P}(s) &= \langle{x_1 + a_1s,y_1+b_1s,z_1+c_1s}\rangle\\[4pt] \vec{Q}(t) &= \langle{x_2 + a_2t,y_2+b_2t,z_2+c_2t}\rangle\\[4pt] \end{align*} where $(x_1,y_1,z_1)$ and $(x_2,y_2,z_2)$ are known points on the respective lines, and $\langle{a_1,b_1,c_1}\rangle$ and $\langle{a_2,b_2,c_2}\rangle$ are known direction vectors for the respective lines.

Assuming the lines are skew, the pair of closest points $\vec{P}(s),\vec{Q}(t)$ satisfy \begin{align*} \left(\vec{P}(s)-\vec{Q}(t)\right)\cdot\langle{a_1,b_1,c_1}\rangle=0\\[4pt] \left(\vec{P}(s)-\vec{Q}(t)\right)\cdot\langle{a_2,b_2,c_2}\rangle=0\\[4pt] \end{align*} which is a system of two linear equations in the two unknowns, $s,t$.

Solve the system for $s,t$, and you have your pair of closest points.

Here's a worked example to illustrate the process . . .

Consider the two lines \begin{align*} \vec{P}(s) &= \langle{s,1+2s,2+3s}\rangle\\[4pt] \vec{Q}(t) &= \langle{3-4t,2-3t,1+2t}\rangle\\[4pt] \end{align*} which are, in fact, skew lines.

Then the pair of closest points $\vec{P}(s),\vec{Q}(t)$ satisfy \begin{align*} &\left(\vec{P}(s)-\vec{Q}(t)\right)\cdot\langle{1,2,3}\rangle=0\\[4pt] &\left(\vec{P}(s)-\vec{Q}(t)\right)\cdot\langle{-4,-3,2}\rangle=0\\[4pt] \end{align*} which yields the system \begin{align*} 7s+2t&=1\\[4pt] 4s+29t&=17\\[4pt] \end{align*} of two linear equations in the two unknowns, $s,t$.

Solving the system, we get \begin{align*} s&=-{\small{\frac{1}{39}}}\\[4pt] t&={\small{\frac{23}{39}}}\\[4pt] \end{align*} which yields the pair of closest points \begin{align*} P&= \bigl( -{\small{\frac{1}{39}}}, {\small{\frac{37}{39}}}, {\small{\frac{25}{13}}} \bigr)\\[4pt] Q&= \bigl( {\small{\frac{25}{39}}}, {\small{\frac{3}{13}}}, {\small{\frac{85}{39}}} \bigr) \end{align*}

0
On

Form the cross product of the direction vectors to find the direction perpendicular to both lines. Project the lines along this direction; the intersection $X$ of the projected lines is the common projection of the two points you're looking for; these points are the intersections of the two lines with the line through $X$ along the perpendicular direction.

0
On

Let the first line be defined by the point $P$ and the direction $\vec p$, and the second by $Q$ and $\vec q$. We want to find the points $P_\perp=P+u\vec p$ and $Q_\perp=Q+v\vec q$ such that $P_\perp Q_\perp$ is perpendicular to both $\vec p$ and $\vec q$.

So, assuming $\vec p,\vec q$ normalized and letting $\cos\theta:=\vec p\cdot\vec q$,

$$(PQ-u\vec p+v\vec q)\cdot\vec p=(PQ-u\vec p+v\vec q)\cdot\vec q=0$$ or

$$\begin{cases}u-v\cos\theta=PQ\cdot\vec p,\\u\cos\theta-v=PQ\cdot\vec q.\end{cases}$$

The solution of the $2\times2$ system is given by

$$\begin{cases} u\sin^2\theta=PQ\cdot\vec p-PQ\cdot\vec q\cos\theta,\\ v\sin^2\theta=PQ\cdot\vec p\cos\theta-PQ\cdot\vec q. \end{cases}$$