# Find the point which lie in a 3d line.

1. Jun 28, 2009

### parch

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.

2. Jun 28, 2009

### Office_Shredder

Staff Emeritus
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

3. Jun 29, 2009

### parch

hi shredder,

(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.

4. Jun 29, 2009

### HallsofIvy

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).

5. Jun 29, 2009

### parch

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..

6. Jun 30, 2009

### parch

hey thanks... got it...

7. Jun 30, 2009

### HallsofIvy

No, t is not a vector- t is a number. If t were a vector "1- t" would make no sense.