# Distance from point to a line proof

1. Aug 17, 2011

### train449

I couldn't find a Linear Algebra section in the Homework forum. I think you can do this without cal... (I hope, but it's been a long day so you never know)

I am asked to prove that the shortest distance from a point P0(x0,y0) to a given line ax+by+c=0 is |ax0+by0+c|/sqrt(a2+b2)

2. Relevant equations

D(P0, L) ; standard inner product, projection of a vector onto a subspace, orthogonal composition of a vector

3. The attempt at a solution

Seeing as it's a linear algebra class I figured I should probably use some linear algebra methods. (Work attached, summary below)

However I'm still not sure how to deal with the constant term in the line equation.
I tried neglecting the C and having a subspace W: ax + by =0 : span (-b, a). I then drew a vector x = (x0,y0) and from these two I generated an equation for y
y = x - projWx. Then ||y|| is my D(P0,L)

However, I ran into an issue solving for ||y||. I could separate ||y-x|| which gives rise to an inequality but then I'm left with a nasty ||x||||w|| term in my absolute value bracket when I try and put all the terms over sqrt(a2+b2). I'd like that to equal c but that's wishful thinking.

Any help is greatly appreciated.

#### Attached Files:

• ###### Photo 5.jpg
File size:
46.3 KB
Views:
116
2. Aug 17, 2011

### dynamicsolo

If this is the full statement of the problem, then I think you are not being asked to prove that the minimum distance from a line to an external point is the perpendicular distance. In that case, we can exploit this property: pick a point on the line P(x,y) = ( x, -(a/b)x-(c/b) ) ; find a vector from P to P0 and a vector along the direction of the line ; determine the value of x which makes the scalar product of these vectors zero . We now have the coordinates of the point on the line closest to P0 and can compute the distance to that external point.

3. Aug 17, 2011

### train449

genius.

So if I can assume that the shortest distance is along a perpendicular line, is it as simple as showing that for y in W, setting <x,y> = 0 will find x the smallest vector from P to P0?

4. Aug 17, 2011

### train449

It works! Thank you.

5. Aug 17, 2011

### dynamicsolo

One could also take the approach of finding a vector from P0 to the line which has a "slope" which is the negative reciprocal of the slope of the line, locate the intersection point on the line, and calculate the distance. But I figured the first way I described would be more "vector algebra-flavored"...

6. Aug 18, 2011

### train449

Indeed. Interesting flavor it is. I'm still a little curious about Ax+By+C=0. I was trying to find anything about the formula that would lend itself to the problem, i.e. why they gave me the line in general form. From what I remember from grade 10, it made calculating D(P,L) fairly easy. I was looking for the linear algebra "flavor" in the process.

Last edited: Aug 18, 2011
7. Aug 18, 2011

### dynamicsolo

The different forms of the equation for a line have various virtues and limitations. The "general form" is convenient because it is easy to immediately find both intercepts and (as you've just shown) we can read off the closest approach it makes to the origin as $$\frac{c}{\sqrt{a^{2} + b^{2}}} .$$ (This result, incidentally, generalizes to higher dimensions, for equations of planes in $$R^{3} ,$$ and so forth.)

The point-slope and slope-intercept forms do have their uses where they can be more convenient than the general form, so I always show students all three.

8. Aug 18, 2011

### train449

Very cool. Thank you.