# Distance between point and a line

1. Aug 24, 2010

### TheAntithesis

I want to find the minimum distance between a point (i,j,k) and the line given by parametric equations x(t)=a+pt , y(t)=b+qt , z(t)=c+rt.

I know how to find the distance between a point and a normal line (non parametric), but I have no idea how to go about finding the distance here.

How should I go about doing this question? An example would be very helpful.

2. Aug 24, 2010

### lanedance

why not try and re-write the line non-parametrically then?

otherwise its the same idea, the shortest vector joining the line and the plane will be perpindicular to the line (why?)

3. Aug 24, 2010

### TheAntithesis

Re-write the line as in the form (a+pt,b+qt,c+rt) ? I still don't know what to do with the t.

4. Aug 25, 2010

### lanedance

try a little rearranging
(x-a)/p = (y-b)/q = (z-c)/r = t

now try and find a single equation relating x,y,z... if that will help you solve the problem, as you said you knew how to use it then

otherwise I would
- find the direction of the line
- find the vector, say u, from the point, to any point on the line
- then the component of u, that is perpindicular to the line will give you the distance

5. Aug 25, 2010

### TheAntithesis

Ok cool, thanks. I'm guessing my answer will be a function of t?

6. Aug 25, 2010

### Staff: Mentor

[STRIKE]Must be.[/STRIKE]

Actually once you have (a+pt,b+qt,c+rt) and (i,j,k) looks to me like it is just a matter of expressing the distance between the points as a function of t...

Edit: I am an idiot, final answer will be a function of a,b,c,p,q,r,i,j,k, not t.

Last edited: Aug 25, 2010
7. Aug 25, 2010

### hunt_mat

No, it's simple. Compute the distance (or distnace^{2} will do) from your point to a general point on your line. To minimise this, differentiate w.r.t. t and then substitute the t you found from differentiating back into your equation to find the minimum distance.

8. Aug 25, 2010

### lanedance

yep thats easier

9. Aug 25, 2010

### TheAntithesis

Oh god..

Ok say the point is (-5,10,13) with its position vector v and the line is given by equation r(t) = (-57,75,0) + t(-4,5,-1).

A point on the line is P(-4,5,-1) so that's the position vector u.
Then the line between the two points would be would be v - u = w = (-5,10,3) - (-4,5,-1) = (-9,5,14)

So I'm guessing all I need to do is find for which t the w.r(t) = 0 then put it back into the r(t) and find the distance between the two points?

I solved for t and got 35.52

Subbed it back into the line equation and got point coordinates Q(85.08,252.6,-35.52)

Then the distance between the two points is |PQ| = sqrt(90.08^2 + 242.6^2 + (-48.52)^2) = 263.293.

Does this method and answer seem reasonable?

10. Aug 25, 2010

### hunt_mat

It does, check it using the method I proposed and see if you getthe same answer, if they match then you've done it.

Mat

11. Aug 25, 2010

### HallsofIvy

Staff Emeritus
The crucial fact is that the shortest distance from a point to a line is measured along the perpendicular to the line.

Given a line in 3 dimensions, you can construct the vector in the direction of the line.

Given a point, p, in 3 dimensions, you can write the equation of the plane containing that point and having the vector, above, as normal vector.

You can then determine the point, q, where the given line crosses the plane. The shortest distance from point to line is the distance from point p to point q.