Results 1 to 3 of 3

Math Help - Finding if a point lies on a line between 2 others

  1. #1
    Newbie
    Joined
    Nov 2008
    Posts
    1

    Unhappy Finding if a point lies on a line between 2 others

    3 points (a,b) (c,d) and (e,f)
    I need to know if point (e,f) lies on the line passing through (a,b) and (c,d)
    I know that is the slope of all the lines is the same then they all lie on the same point... but I'm doing that and it's not working!

    if you can do that... then how about this...

    Take the line through (a,b) and (c,d) and draw a line perpendicular to it at point (a,b).

    Now find if point (e,f) lies on the same side of the perpendicular line as (c,d) or not!

    These are both for a PC program I'm writing, and my maths really isn't up to scratch! I'm getting a headache and could really do with some help! Please bear in mind, the answer needs to be "zero proof", as in, the computer can't devide by zero, so it needs to avoid that...
    any help muchly appreciated!
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Super Member
    earboth's Avatar
    Joined
    Jan 2006
    From
    Germany
    Posts
    5,830
    Thanks
    123
    Quote Originally Posted by peanutbutterfingers View Post
    3 points (a,b) (c,d) and (e,f)
    I need to know if point (e,f) lies on the line passing through (a,b) and (c,d)
    I know that is the slope of all the lines is the same then they all lie on the same point... but I'm doing that and it's not working!

    ...
    Take the points P(a, b) and Q(c, d) to determine the equation of the line PQ. Use the 2-point-formula of a straight line:

    PQ: \dfrac{y-b}{x-a}=\dfrac{d-b}{c-a}

    Now plug in the coordinates of point R(e, f) instead of x and y. If the equation becomes true then the 3 points lie on a line:

     \dfrac{f-b}{e-a}=\dfrac{d-b}{c-a}
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Super Member
    earboth's Avatar
    Joined
    Jan 2006
    From
    Germany
    Posts
    5,830
    Thanks
    123
    Quote Originally Posted by peanutbutterfingers View Post
    ...

    These are both for a PC program I'm writing, and my maths really isn't up to scratch! I'm getting a headache and could really do with some help! Please bear in mind, the answer needs to be "zero proof", as in, the computer can't devide by zero, so it needs to avoid that...
    any help muchly appreciated!
    To avoid the division by zero you have to prove if

    i) a = c = e. Then the 3 points are lying on a line perpendicular to the x-axis;

    ii) b = d = f. Then the 3 points are lying on a line perpendicular to the y-axis.

    A simple if - then - else will do.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 2
    Last Post: June 8th 2010, 05:59 PM
  2. point lies closest ot the y axis
    Posted in the Calculus Forum
    Replies: 3
    Last Post: May 3rd 2010, 08:03 AM
  3. Replies: 9
    Last Post: March 14th 2010, 09:46 AM
  4. Finding closest point on line to a point
    Posted in the Geometry Forum
    Replies: 2
    Last Post: February 3rd 2010, 12:28 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, 01:21 AM

Search Tags


/mathhelpforum @mathhelpforum