# Distance between a point and a line and between two lines

Let $$P = (-5, 3, 4)$$, $$Q = (-6, 0, 3)$$, $$R = (-7, 1, 6)$$ and $$S = (-4, 2, 2)$$. Let $$A$$ be the line passing through $$P$$ and $$Q$$, and let $$B$$ be the line passing through $$R$$ and $$S$$.

a) What is the distance between $$R$$ and $$A$$?

b) What is the distance between $$A$$ and $$B$$?

I am quite confused on how to start with this problem. Firstly, I am not entirely sure how I will find the distance between the point and the line. Would that distance simply be the normal vector multiplied by the projection? If so, how exactly would I calculate the projection here? No equations for the lines are given so I am quite confused.

Also, for the shortest distance between two lines, will it be a similar approach of finding the normal vector and projection?

I am not entirely sure how to proceed here. Any help would be highly appreciated!

• Have you studied calc 3 yet? The first part of it you learn how to do this. Mar 16 '18 at 3:12
• I am in Calc 2 at the moment (haven't done calc 3). This is for my first year linear algebra class. Mar 16 '18 at 3:16
• You can Google it if you like. I'm sure there's a ton of material out there. But what happens when you read the chapter the question came from? Is there anything that's confusing that l/we could help you with? Mar 16 '18 at 3:20
• @AmateurMathGuy doesn't my answer answer his question? Any way I can improve it? Sorry I'm new to Math SE. Mar 16 '18 at 3:22
• @AmateurMathGuy Well usually I can get up to finding the normal vector. But in this case I don't know how to even do that because the equations for the lines haven't been given. And also, I am not entirely sure how to proceed after finding the normal vector. I know we have to use projections but I am not sure how. That's basically my problem here. If I can just see a more clear explanation for the entire process, that would be perfect. I kind of lost track in class after finding the normal vector. Mar 16 '18 at 3:23

(a) Let $X$ be a point on $A$ such that $RX$ is the minimum. Then $X=t(-5,3,4)+(1-t)(-6,0,3)$ for some $t\in\mathbb{R}$. $RX$ is peprpendicular to $A$. We can find $t$ by dot product.

(b) Let $Y$ be the point on $A$ and $Z$ be the point on $B$ such that $YZ$ is the minimum. Then $Y=t(-5,3,4)+(1-t)(-6,0,3)$ and $Z=s(-7,1,6)+(1-s)(-4,2,2)$ for some $s,t\in\mathbb{R}$. $YZ$ is perpendicular to both $A$ and $B$. Again, we can find $s$ and $t$ by taking dot products.

Although what @AmateurMathGuy says is VERY useful :P there is a formula you can use called the point to line formula that basically says: $$d = \frac{|ax_0+by_0+c|}{\sqrt{a^2+b^2}}$$ where the line is $ax+by+c=0$ and the point is $(x_0,y_0)$.

The correct way to do it on the other hand, without using this formula is to first find the line through the point perpendicular to the line in question. Then, find the intersection of these two lines. Then, find the distance from the point in question to the intersection point. That is your distance.

• how is this relevant? the question is about lines and points in 3 dimensions, and this formula concerns the plane
Mar 16 '18 at 7:19

Even if you're only in Calc I, you can still do this. Write an equation for the distance from the point to an arbitrary point on the line and then differentiate the equation you come up with with respect to $x$. The value of the derivative will be zero when your equation for the distance from the point to the line is at a minimum and this will give you the $x$ value on the line where the point is closest to. You can then get the $y$ and $z$ values from the original equation for the line.

Let P = (-5, 3, 4), Q = (-6, 0, 3), R = (-7, 1, 6) and S = (-4, 2, 2). Let A be the line passing through P and Q, and let B be the line passing through R and S.

a)What is the distance between R and A?

parametrise A to get $$x=-5-t,y=3-3t,z=4-t$$

The distance is minimized when $$D^2 =(t-2)^2+(3t-2)^2+(t+2)^2$$ is minimized.

Upon differentiation and solving for t, you find the minimum distance between R and A.

b) What is the distance between A and B?

parametrise B to get $$x=-7+3s,y=1+s,z=6-4s$$

The distance is minimized when

$$D^2= (-5-t+7-3s)^2 +(3-3t-1-s)^2+(4-t-6+4s)^2$$ is minimized.

Differentiate with respect to t and s.

Solve for t and s to find the minimum distance.

• You cannot take the same parameter for a point on $A$ and a point on $B$. Mar 16 '18 at 8:41
• Thanks, I have fixed this problem. Please check the edited version. Mar 16 '18 at 12:09