Results 1 to 6 of 6

Math Help - Finding the point on a line closest to another point

  1. #1
    Newbie
    Joined
    May 2011
    Posts
    6

    Question Finding the point on a line closest to another point

    I'm sure we've all heard the classic vector algebra problem: "Find the shortest distance from the line y=mx+b to the point (x0, y0)". I'm interested in a variation on this problem that I've been bashing my head against for a couple days now.

    I'm not concerned with the shortest distance, but the point on the line where that shortest distance occurs. To make the problem worse, I'm dealing with three dimensions.

    For example, I have a line defined by two points, let's say (0,1,2) and (6,2,7). I want to find the point on this line closest to the point (3,-7,-4).

    I'm comfortable with vector math, including dot and cross products, normalizing, addition, all that. I'm just not sure what combination of operations will get me the point I'm looking for.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor
    Joined
    Sep 2012
    From
    Australia
    Posts
    3,619
    Thanks
    592

    Re: Finding the point on a line closest to another point

    Hey MofoMan2000.

    Try deriving a norm expression that gets the distance from a fixed point, to a position on the line. If you have a parameterized x(t), y(t), z(t), then the norm will simply be ||.||^2 = (x(t) - x0)^2 + (y(t) - y0)^2 + (z(t) - z0)^2 where (x(t),y(t),z(t)) is the position of the line at parameter t, and (x0,y0,z0) is the fixed point.

    By minimizing ||.||^2 (which is easier than minimizing the non-square version since you have square roots) you can find the closest point that way.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    May 2011
    Posts
    6

    Re: Finding the point on a line closest to another point

    True, I could minimize the distance function, it's a good method. But it isn't very efficient from a programmatic point of view. I was thinking more of using a vector-based approach, since the vector from the line to the point would, of course, be orthogonal to the line. If I can find that vector, I can find the point on the line, or vice versa.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    MHF Contributor

    Joined
    Aug 2006
    Posts
    18,615
    Thanks
    1577
    Awards
    1

    Re: Finding the point on a line closest to another point

    Quote Originally Posted by MofoMan2000 View Post
    I'm not concerned with the shortest distance, but the point on the line where that shortest distance occurs. To make the problem worse, I'm dealing with three dimensions.

    For example, I have a line defined by two points, let's say (0,1,2) and (6,2,7). I want to find the point on this line closest to the point (3,-7,-4).
    Name the points: A: (0,1,2),~B: (6,2, 7),~\&~M: (3,-7,-4).

    Write the equation of the plane, \Pi , through M with normal \overrightarrow {AB} .

    The point you want is \overleftrightarrow {AB} \cap \Pi .
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Newbie
    Joined
    May 2011
    Posts
    6

    Re: Finding the point on a line closest to another point

    Quote Originally Posted by Plato View Post
    Name the points: A: (0,1,2),~B: (6,2, 7),~\&~M: (3,-7,-4).

    Write the equation of the plane, \Pi , through M with normal \overrightarrow {AB} .

    The point you want is \overleftrightarrow {AB} \cap \Pi .
    Thanks, that got me exactly what I needed.

    First, I define vector \overrightarrow {Q} as \overrightarrow {AB} normalized.
    I then define my line by three parametric equations using the normal as coefficients for a parameter t, and add point A.
    Then I construct the equation for a plane using normal \overrightarrow {Q} and point M.
    I substitute my parametric equations for x y and z into the plane equation and solve for t.
    When I plug that t back into the parametric equations for x y and z y I have my point.

    Thanks again!
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Super Member
    Joined
    Dec 2012
    From
    Athens, OH, USA
    Posts
    631
    Thanks
    254

    Re: Finding the point on a line closest to another point

    Hi,
    I've attached a general formula for the point you seek. The formula is probably not worth remembering, but the technique used to derive the formula is worthwhile, I think. The formula is useful in a programming environment.

    Finding the point on a line closest to another point-mhflinearalgebra5.png
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Finding closest point on line to a point
    Posted in the Geometry Forum
    Replies: 2
    Last Post: February 3rd 2010, 11:28 AM
  2. Replies: 2
    Last Post: November 5th 2009, 12:05 PM
  3. Find the point on the line, closest to a point
    Posted in the Calculus Forum
    Replies: 3
    Last Post: July 14th 2009, 05:41 PM
  4. Point on a line closest to the origin
    Posted in the Calculus Forum
    Replies: 5
    Last Post: November 18th 2007, 08:27 PM
  5. Finding a point on a line closest to a given point
    Posted in the Pre-Calculus Forum
    Replies: 4
    Last Post: October 6th 2007, 12:21 AM

Search Tags


/mathhelpforum @mathhelpforum