MHB How Do You Calculate the Distance Between Two Skew Lines?

  • Thread starter Thread starter Petrus
  • Start date Start date
  • Tags Tags
    Lines
Click For Summary
To calculate the distance between two skew lines, the discussion revolves around the lines defined by their parametric equations and the need to find a vector connecting points on each line that is perpendicular to both. The user initially struggles with the equations of the second line and how to express points on it. After several exchanges, they establish that the distance can be found by ensuring the vector between points on the two lines is orthogonal to the direction vectors of both lines. The final calculations involve solving a system of equations derived from the orthogonality conditions, although discrepancies with the expected results indicate potential miscalculations. The conversation emphasizes the importance of correctly applying vector mathematics to solve for the distance between skew lines.
Petrus
Messages
702
Reaction score
0
Hello MHB,
This is a problem from my book,
calculate distance between line $$l_1: (x,y,z) = (1,1,3)+t(1,-2,-3)$$ and
b49o3l.png


(hope it work's read $$l_2$$ cause I don't know how to write that in latex)
I am stuck when I got $$l_2$$ in plane.
I start with $$l_1$$
$$P=(1+t,1-2t,3-3t)$$
what shall I do with $$l_2$$?

Regards,
$$|\pi\rangle$$
 
Last edited:
Physics news on Phys.org
Petrus said:
Hello MHB,
This is a problem from my book,
calculate distance between line $$l_1: (x,y,z) = (1,1,3)+t(1,-2,-3)$$ and
b49o3l.png


(hope it work's read $$l_2$$ cause I don't know how to write that in latex)
I am stuck when I got $$l_2$$ in plane.
I start with $$l_1$$
$$P=(1+t,1-2t,3-3t)$$
what shall I do with $$l_2$$?

Regards,
$$|\pi\rangle$$

Hey I pi rangle! ;)

Which methods do you know to determine the distance between 2 lines?

What you can do for instance with $$l_2$$ is find a support vector and a direction vector, so you can define a point Q similar to your point P with 1 parameter.

If you click Reply With Quote you can see how I put your set of equations in $\LaTeX$.
$$l_2:
\left\{
\begin{aligned}
x-\phantom{1}y+3z-1 &= 0 \\
-2x + 3y -6z - 3 &= 0 \\
\end{aligned}
\right.$$
 
I like Serena said:
Hey I pi rangle! ;)

Which methods do you know to determine the distance between 2 lines?

What you can do for instance with $$l_2$$ is find a support vector and a direction vector, so you can define a point Q similar to your point P with 1 parameter.

If you click Reply With Quote you can see how I put your set of equations in $\LaTeX$.
$$l_2:
\left\{
\begin{aligned}
x-\phantom{1}y+3z-1 &= 0 \\
-2x + 3y -6z - 3 &= 0 \\
\end{aligned}
\right.$$
Hello I like Serena!
Thanks for showing me the latex code!:)
I know two method one when you do from point to plane which I don't prefer. The method I always use that we is calculate the distance between a vector $$|PQ|$$
this parameter I am unsure with what I shall use.

Regards,
$$|\pi\rangle$$
 
Petrus said:
Hello I like Serena!
Thanks for showing me the latex code!:)
I know two method one when you do from point to plane which I don't prefer. The method I always use that we is calculate the distance between a vector $$|PQ|$$
this parameter I am unsure with what I shall use.

Regards,
$$|\pi\rangle$$

Can you solve for instance x and y from the set of equations (leaving z as an unknown)?
 
I like Serena said:
Can you solve for instance x and y from the set of equations (leaving z as an unknown)?
Hello I like Serena
I get y=5 and $$x=4-3z$$

Regards,
$$|\pi\rangle$$
 
Petrus said:
Hello I like Serena
I get y=5 and $$x=4-3z$$

Regards,
$$|\pi\rangle$$

Let's see...

We have $x−y+3z−1=0$.
Substituting your solution, I get:

$$(4-3z)-(5)+3z-1 =0 \\
-2=0 $$

That can't be right!
 
I like Serena said:
Let's see...

We have $x−y+3z−1=0$.
Substituting your solution, I get:

$$(4-3z)-(5)+3z-1 =0 \\
-2=0 $$

That can't be right!
Hello I like Serena
I made some typo sorry!
$$y=5 $$ and $$x=6-3z$$

Regards,
$$|\pi\rangle$$
 
Last edited:
Petrus said:
Hello I like Serena
I made some typo sorry!
$$y=5 $$ and $$x=6-3z$$

Regards,
$$|\pi\rangle$$

Good!

Now point $Q$ can be expressed for instance as $(6-3z, 5, z)$.
Or I might also say that $l_2$ is $(6,5,0)+s(-3,0,1)$.

There are a couple of ways to proceed.
Perhaps you already know a way?
 
I like Serena said:
Good!

Now point $Q$ can be expressed for instance as $(6-3z, 5, z)$.
Or I might also say that $l_2$ is $(6,5,0)+s(-3,0,1)$.

There are a couple of ways to proceed.
Perhaps you already know a way?
Hello I like Serena,
Is my method not valid or I am doing something wrong cause I don't get same answer as facit...
We got that
$$PQ=(5-3z-t,4+2t,z-3+3t)$$
We know that $$PQ*(1,-2,-3)=0$$ and $$PQ*(-3,0,1)=0$$
then I get this equation
$$6t+10z=-18$$
$$14t+6z=6$$
and we get $$t=-\frac{6}{13}$$, $$z=\frac{27}{13}$$
that means $$PQ=(-\frac{10}{13},\frac{40}{13},-\frac{30}{13})$$
but this is wrong, and I can't see where..

Regards,
$$|\pi\rangle$$
 
  • #10
Petrus said:
We got that
$$PQ=(5-3z-t,4+2t,z-3+3t)$$
We know that $$PQ*(1,-2,-3)=0$$ and $$PQ*(-3,0,1)=0$$

Good.

then I get this equation
$$6t+10z=-18$$
$$14t+6z=6$$

I don't. How did you get it?
 
  • #11
I like Serena said:
Good.
I don't. How did you get it?
Hello I like Serena
$$5-3z-t-2(4+2t)-3(z-3+3t)=0$$
$$-3(5-3z-t)+z-3+3t=0$$

Regards,
$$|\pi\rangle$$
 
  • #12
Hello,
Now I get this equation if I have not made any misscalculation...
$$-6z-14t=-6$$
$$-8z+6t=18$$
$$t=\frac{39}{37}$$, $$z=-\frac{54}{37}$$

Regards,
$$|\pi\rangle$$
 
  • #13
This would be my way of continuing:

We begin with the two lines
$$l_1: (x,y,z) = (1,1,3)+t(1,-2,-3)$$
$$l_2: (x,y,z) = (6,5,0)+s(-3,0,1)$$

Now, take any two points on the line, and find the vector going from one to the other. Let's define $P_1=(1,1,3)$ and $P_2=(6,5,0)$. The vector connecting them is then
$$v = P_2 - P_1 = \langle 5,4,-3\rangle$$

Now, you need the component of this vector that is perpendicular to either line. In order to do so, you need some unit vector perpendicular to both $l_1$ and $l_2$. An easy way to find one is to take and normalize the cross product of the line vectors
$$n = \langle 1,-2,-3\rangle \times \langle -3,0,1\rangle
= \langle -2,8,-6 \rangle$$
$$u = n/ \| n \| = \frac{1}{\sqrt{26}} \langle -1,4,-3 \rangle $$

To finish, we have

$$dist = \left| v \cdot u \right| = \left| \frac{1}{\sqrt{26}} ((-1)(5)+(4)(4)+(-3)(-3)) \right|
\\= \frac{20}{\sqrt{26}} \approx 3.92 $$

Is that anything like how you're supposed to do it?
 
Last edited:
  • #14
TheBigBadBen said:
This would be my way of continuing:

We begin with the two lines
$$l_1: (x,y,z) = (1,1,3)+t(1,-2,-3)$$
$$l_2: (x,y,z) = (6,5,0)+s(-3,0,1)$$

Now, take any two points on the line, and find the vector going from one to the other. Let's define $P_1=(1,1,3)$ and $P_2=(6,5,0)$. The vector connecting them is then
$$v = P_2 - P_1 = \langle 5,4,-3\rangle$$

Now, you need the component of this vector that is perpendicular to either line. In order to do so, you need some unit vector perpendicular to both $l_1$ and $l_2$. An easy way to find one is to take and normalize the cross product of the line vectors
$$n = \langle 1,-2,-3\rangle \times \langle -3,0,1\rangle
= \langle -2,8,-6 \rangle$$
$$u = n/ \| n \| = \frac{1}{\sqrt{26}} \langle -1,4,-3 \rangle $$

To finish, we have

$$dist = \left| v \cdot u \right| = \left| \frac{1}{\sqrt{26}} ((-1)(5)+(4)(4)+(-3)(-3)) \right|
\\= \frac{20}{\sqrt{26}} \approx 3.92 $$

Is that anything like how you're supposed to do it?
Hello,
Your method works fine so should my, I have done some with my method and it works, I don't understand what I am doing wrong

Regards,
$$|\pi\rangle$$
 
  • #15
Petrus said:
Hello,
Your method works fine so should my, I have done some with my method and it works, I don't understand what I am doing wrong

Regards,
$$|\pi\rangle$$

Well, I can't tell you what you're doing wrong because I don't really understand your method. Why are you solving for z and t? What information are you looking for, and how does it tie into finding the distance between lines?
 
  • #16
TheBigBadBen said:
Well, I can't tell you what you're doing wrong because I don't really understand your method. Why are you solving for z and t? What information are you looking for, and how does it tie into finding the distance between lines?
Hello TheBigBadBen,
We want to find z and t so we know PQ, notice that P is on line 1 and Q is on line 2 so with other words Distance between two line is same as |PQ| the length of PQ

Regards,
$$|\pi\rangle$$
 
  • #17
Petrus said:
Hello TheBigBadBen,
We want to find z and t so we know PQ, notice that P is on line 1 and Q is on line 2 so with other words Distance between two line is same as |PQ| the length of PQ

Regards,
$$|\pi\rangle$$

All right, now I see. You're saying that for any point P on line 1 and point Q on line 2, we can write the vector between those two points as

$$PQ=(5-3z-t,4+2t,z-3+3t)$$

Which is correct. Presumably, for the right choice of P and Q, we'd be able to say that the length of that vector is the distance between the two lines. Now, what you need to do (and I now see that this is what you were trying to do) is find such a PQ that is perpendicular to both of the lines. Thus, we need to satisfy
$$ PQ \cdot (1,-2,-3) = 0\\
PQ \cdot (-3,0,1) = 0$$
Which will yield a unique PQ connecting the lines. Finding the length of that should yield the correct answer.

Perfect. Now that I understand, I'll try to see where that went wrong.
 
  • #18
Petrus said:
Hello,
Now I get this equation if I have not made any misscalculation...
$$-6z-14t=-6$$
$$-8z+6t=18$$
$$t=\frac{39}{37}$$, $$z=-\frac{54}{37}$$

Regards,
$$|\pi\rangle$$

Your equation is still not quite right.

Let's clean it up a bit.

$$\vec{PQ} = \begin{pmatrix}5\\4\\-3\end{pmatrix} + z \begin{pmatrix}-3\\0\\1\end{pmatrix} - t \begin{pmatrix}1\\-2\\-3\end{pmatrix}$$

Since $\vec{PQ} \perp \begin{pmatrix}1\\-2\\-3\end{pmatrix}$, we get:
$$(5-8+9)+z(-3-3)-t(1+4+9)=0$$
And since $\vec{PQ} \perp \begin{pmatrix}-3\\0\\1\end{pmatrix}$, we get:
$$(-15-3)+z(9+1)-t(-3-3)=0$$

Which equations do you get from that?
 
  • #19
I like Serena said:
Your equation is still not quite right.

Let's clean it up a bit.

$$\vec{PQ} = \begin{pmatrix}5\\4\\-3\end{pmatrix} + z \begin{pmatrix}-3\\0\\1\end{pmatrix} - t \begin{pmatrix}1\\-2\\-3\end{pmatrix}$$

Since $\vec{PQ} \perp \begin{pmatrix}1\\-2\\-3\end{pmatrix}$, we get:
$$(5-8+9)+z(-3-3)-t(1+4+9)=0$$
And since $\vec{PQ} \perp \begin{pmatrix}-3\\0\\1\end{pmatrix}$, we get:
$$(-15-3)+z(9+1)-t(-3-3)=0$$

Which equations do you get from that?
Hello I like Serena,
$$6z+14t=6$$
$$10z+9t=18$$
that means $$t=-\frac{24}{43}$$ and $$z=\frac{99}{43}$$
that means $$PQ=(-\frac{58}{43},\frac{124}{43},-\frac{102}{43})$$
then we get the distance is and that is not the same as facit..

Regards,
$$|\pi\rangle$$
 
  • #20
Petrus said:
Hello I like Serena,
$$6z+14t=6$$
$$10z+9t=18$$
that means $$t=-\frac{24}{43}$$ and $$z=\frac{99}{43}$$
that means $$PQ=(-\frac{58}{43},\frac{124}{43},-\frac{102}{43})$$
then we get the distance is and that is not the same as facit..

Regards,
$$|\pi\rangle$$

Can you try to simplify $(−15−3)+z(9+1)−t(−3−3)=0$ again?
 

Similar threads

  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
8K
Replies
33
Views
5K
Replies
8
Views
3K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 2 ·
Replies
2
Views
1K