How to calculate line-line distance when cross product of directions is 0?

448 Views Asked by At

I have the lines

$$\frac{x-1}{2} = 1-y = \frac{z-2}{3} \tag{1}$$

and

$$\frac{x+1}{4} = \frac{4-y}{2} = \frac{z+1}{6} \tag{2}$$

I want to compute the distance between them.

I started by putting them in vector form:

$$r_1 = (1,1,2) + x(2,-1,3) \tag{3}$$

and

$$r_2 = (-1,4,-1) + y(4,-2,6) \tag{4}$$

I then wanted to project a line connecting the two along the unit normal to both lines. However, when I computed the cross product of their directions, I get $(0,0,0)$. This led me to believe the distance between the lines is zero - which is not the case.

What have I done wrong?

2

There are 2 best solutions below

10
On

The distance you want is the shortest distance which is perpendicular to both lines. Take any point on the two lines in terms of any parameter you want to assign say $k_1$ and $k_2$ suppose points are $P_1:(f_1(k_1),f_2(k_1),f_3(k_1)$ on $L_1$ and $P_2:(f_4(k_2),f_5(k_2),f_6(k_2)$ on $L_2$ . The direction cosine joining the two point, $P_2-P_1$ and if you find shortest distance these direction cosine should be perpendicular to both the lines. Solve for the variable $k_1$ and $k_2$ from these condition you got the points and thus the distance.

0
On

The most common way to calculate the distance not using the cross product is:
Let $\mathbf{r}_1=\mathbf{A}+x\mathbf{l}_1$, $\mathbf{r}_2=\mathbf{B}+y\mathbf{l}_2$ the lines and $(\mathbf{a},\mathbf{b})$ the inner(or the dot) product of $\mathbf{a},\mathbf{b}$.
(a) We find 2 points $\mathbf{r}_1, \mathbf{r}_2$ on the lines such, that $(\mathbf{r}_1-\mathbf{r}_2,\mathbf{l}_1)=0$ and $(\mathbf{r}_1-\mathbf{r}_2,\mathbf{l}_2)=0$ (i.e. $\mathbf{r}_1-\mathbf{r}_2$ perpendicular to both lines)
(b) then $|\mathbf{r}_1-\mathbf{r}_2|$ would be the distance.
However, if $\mathbf{l}_1||\mathbf{l}_2$, only one variable vanishes as the two equations above are equivalent, so you just substitute the other variable into $|\mathbf{r}_1-\mathbf{r}_2|$ and it vanish as the lines are parallel.
In the case above:
$\mathbf{r}_1=(1,1,2)+x(2,−1,3), \mathbf{r}_2=(−1,4,−1)+y(4,−2,6),$
$\mathbf{r}_1-\mathbf{r}_2=(2,-3,3)+(x-2y)(2,−1,3)$ $(\mathbf{r}_1-\mathbf{r}_2,\mathbf{l}_1)=((2,-3,3)+(x-2y)(2,−1,3),(2,−1,3))=$
$((2,-3,3),(2,−1,3))+(x-2y)((2,−1,3),(2,−1,3))=16+14(x-2y)=0$
$x-2y=-\frac{8}{7}$
$\mathbf{r}_1-\mathbf{r}_2 = (2,-3,3)-\frac{8}{7}(2,−1,3)=\left(-\frac{2}{7}, -\frac{13}{7}, -\frac{3}{7}\right)$
$|\mathbf{r}_1-\mathbf{r}_2|=\frac{\sqrt{2^2+13^2+3^2}}{7}=\frac{\sqrt{182}}{7}$