Find the point which lie in a 3d line.

  • Thread starter Thread starter parch
  • Start date Start date
  • Tags Tags
    3d Line Point
parch
Messages
17
Reaction score
0
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 anyone give me simple algorithm other than logic.


Thanks in advance.
 
Physics news on Phys.org
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
 
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.
 
parch said:
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.
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).
 
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 please..
 
hey thanks... got it...
 
parch said:
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 please..
No, t is not a vector- t is a number. If t were a vector "1- t" would make no sense.
 
Back
Top