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

Find the point which lie in a 3d line.

  1. Jun 28, 2009 #1
    hi

    I know two points in 3d space.I know another point in the space and need to know whether that point lie in between the two points(i.e same line). can any one give me simple algorithm other than logic.


    Thanks in advance.
     
  2. jcsd
  3. Jun 28, 2009 #2

    Office_Shredder

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    If the coordinates of your first two points are (a,b,c) and (d,e,f) then any point lying on the line going through them will be of the form

    t(a,b,c) + (1-t)(d,e,f)

    for some t. You can easily see that this is a line, and that (a,b,c) and (d,e,f) are on the line

    So you simply have to find whether such a t exists for your third point
     
  4. Jun 29, 2009 #3
    hi shredder,

    I got ur answer, please check whether i am correct.

    (x,y,z) is new point where need to find it is in that path.

    t(a,b,c) + (1-t)(d,e,f)=(x,y,z)

    from this i can get the t, assume my t as t(u,v,w). so these u , v and w should be inbetween 0 and 1,so that t lies in the path, ie in the line.
     
  5. Jun 29, 2009 #4

    HallsofIvy

    User Avatar
    Staff Emeritus
    Science Advisor

    What are "u, v, and w"?

    If there exist any t at all satisfying t(a,b,c) + (1-t)(d,e,f)=(x,y,z), then (x,y,z) is on the line through (a,bc) and (d,e,f). If t lies between 0 and 1, then (x,y,z) is not only on that line, it lies between (a,b,c) and (d,e,f)- i.e. it is on the line segment with endpoints (a,b,c) and (d,e,f).
     
  6. Jun 29, 2009 #5
    from this t(a,b,c) + (1-t)(d,e,f)=(x,y,z), the unknown t will be a vector.which i gave the as (u,v,w). could you come some more detail plz..
     
  7. Jun 30, 2009 #6
    hey thanks... got it...
     
  8. Jun 30, 2009 #7

    HallsofIvy

    User Avatar
    Staff Emeritus
    Science Advisor

    No, t is not a vector- t is a number. If t were a vector "1- t" would make no sense.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook