Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

3 Points in a line!

  1. Jan 14, 2009 #1
    I encountered a problem where it asked us to show whether 3 points belong to a straight line in 3D. I have worked such problems in 2D before, but never in 3D, so i tried to carry out the same idea here as well. I understand that to do such a thing as a way one could start by first deriving the eq. of such a line that connects two points,(using some vector algebra i would think), and then test whether the coordinates of the third point satisfy the equations, however i am interested to know whether the following method would work as well. In fact it worked for 2 or 3 cases that i tested, but i don't know how would i show that it is valid in general.

    I started by assuming that since we are working in 3D, we are gonna have slopes with respect to the x-axis and y-axis as well. Say we have three points in space:


    Now the slopes with respect to x-axis and y-axis respectively would be:

    (i) for the segment(line)


    [tex]\frac{z_2-z_1}{x_2-x_1}, \frac{z_2-z_1}{y_2-y_1}[/tex]

    (ii) for [tex] \bar {P_1P_3}[/tex]


    (iii) for [tex]\bar {P_2P_3}[/tex]


    Now, in order for these points to lie on a straight line, their slopes w.r.t x and y have to be equal.

    Also, after we set them equal, i managed with some elementary algebraic manipulations to come with a single relation, which worked for those same cases i tested:


    THis last expression, indeed, turned out to be not the only one, with some slightly different manipulatoins i could come up with simmilar relations which seemed to work as well.

    So any feedback?

    THnx in advance.
  2. jcsd
  3. Jan 14, 2009 #2
    try this:
    pick any two points
    find the equation
    see if the third point fits.

    i think that is easier than what you did.
    vector algebra is not needed.
    just take two points, (x_1,y_1,z_1),(x_2,y_2,z_2).
    not really sure how this is supposed to work in 3D, but i would find 2 different slopes, one in the xy plane, and one in the yz plane, and just work it out that way.
  4. Jan 15, 2009 #3


    User Avatar
    Science Advisor

    The line through the points [itex](x_1, y_1, z_1)[/itex] and [itex](x_2, y_2, z_2)[/itex] is given by
    [itex]x= x_1+ (x_2-x_1)t[/itex]
    [itex]y= y_1+ (y_2-y_1)t[/itex]
    [itex]z= z_1+ (z_2-z_1)t[/itex]

    If t= 0, that gives [itex](x_1, y_1, z_1)[/itex] and when t= 1, [itex](x_2, y_2, z_2)[/itex]. Since a line is determined by two points that is all you need.

    Now, to determine whether [itex](x_3, y_3, z_3)[/itex] is on that line, try to solve:
    [itex]x_3= x_1+ (x_2-x_1)t[/itex]
    [itex]y_3= y_1+ (y_2-y_1)t[/itex]
    [itex]z_3= z_1+ (z_2-z_1)t[/itex]
    See if that can be solved for a single value of t. Solve, say, the first equation for t and the see if it also satisfies the other two equations. If so the point is on the line, if not, the point is not on the line.
  5. Jan 15, 2009 #4
    Perhaps another possibility is to check if the cross product of the vectors P1P2 and P1P3 is the zero vector. But Halls' method looks neater.
  6. Jan 15, 2009 #5


    User Avatar
    Science Advisor

    Actually, Dodo, I think your suggest is simplest.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook