1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Distance from point to a line proof

  1. Aug 17, 2011 #1
    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:

  2. jcsd
  3. Aug 17, 2011 #2


    User Avatar
    Homework Helper

    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.
  4. Aug 17, 2011 #3

    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?
  5. Aug 17, 2011 #4
    It works! Thank you.
  6. Aug 17, 2011 #5


    User Avatar
    Homework Helper

    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"...
  7. Aug 18, 2011 #6
    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
  8. Aug 18, 2011 #7


    User Avatar
    Homework Helper

    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 [tex] \frac{c}{\sqrt{a^{2} + b^{2}}} . [/tex] (This result, incidentally, generalizes to higher dimensions, for equations of planes in [tex]R^{3} ,[/tex] 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.
  9. Aug 18, 2011 #8
    Very cool. Thank you.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook