# Find the distance between a point and a line (given its vector equation)

1. Sep 28, 2011

### Nickg140143

1. The problem statement, all variables and given/known data
Let $$l_1:<x,y,z>=<2,-1,3>+t<-1,2,1>$$ and $$P(1,3,2)$$ be a line and point in R3, respectively. Find the distance from P to l.

2. Relevant equations
distance between two points in R3
$$d=\sqrt{(x-x_0)^2+(y-y_0)^2+(z-z_0)^2}$$

and the line in this problem is given to us in vector equation form, from which I can find the directional vector v and the position vector r0

3. The attempt at a solution
I'll need a bit of guidance on this problem. I believe that I'm supposed to find the shortest distance between P and some point on line L, and I can only think that the shortest distance between P and some point on L would be some path from P that intersects L at a 90 degree angle (perpendicular to L). I was thinking of perhaps using L's directional vector and the point P in order to construct some line that goes through P and is perpendicular to L, which would mean I would need to cross the directional vector with something?

I'm not too sure on how to go about this, or whether or not this is a proper way of approaching this problem.

Any guidance would be greatly appreciated.

2. Sep 29, 2011

### Staff: Mentor

Yes.
The dot product would be more appropriate. The dot product is zero for two perpendicular vectors.

3. Sep 29, 2011

### LCKurtz

Yes. Draw a picture of a line and a point on the line and your point off the line. Doesn't need to be to scale. Call the point on the line P and draw the line's direction vector with its tail at P. Call the point off the line Q. You can calculate the vector PQ. If you drop the perpendicular to the line from Q, you have a right triangle with PQ as its hypotenuse. Just from trig, the distance from Q to the line is d = |PQ|sin(θ) where θ is the angle between the direction vector D and PQ. Suppose you divide D by its length to make a unit vector U.

Now if take the cross product PQ x U and look at its maginitude:

|PQ x U| = |PQ||U|sin(θ) = |PQ|sin(θ) = d.

To summarize: To get the distance from a point to a line take the magnitude of the cross product of a vector from any point on the line to the external point with the unit direction vector.