# LINE in 3D SPACE

1. Sep 28, 2006

### ronatu

I have a simple question.

Assume we have 2 points in 3D space with known coordinates:
#1 (x1,y1,z1)
and
#2 (x2,y2,z2)
How to find coordinates of point #3 (x,y,z) belongs to the same line with known distance D from point#1?
Equation for transformation will be helpful...

2. Sep 28, 2006

### Werg22

A line in 3d space can be written as two functions that goes through the origin has two equations:

y = mx

and

z/(y^2 + x^2)^1/2 = +- C

Where C is a constant.

Finally the distance between two points in 3d space is given by

(x^2 + y^2 + z^2)^1/2

Work around that...

Last edited: Sep 28, 2006
3. Sep 29, 2006

### HallsofIvy

Staff Emeritus
For example, find the points on the line through (1, 0, 1) and (2, 2, 2) that are a distance d from (1, 0, 1). The vector from (1, 0, 1) to (2, 2, 2) is (2-1)i+ (2-0)j+ (2-1)k= i+ 2j+ k so parametric equations of the line are x= t+ 1, y= 2t, z= t+ 1. The distance from any point (x, y, z) to (1, 0, 1) is $\sqrt{(x-1)^2+ y^2+ (z-1)^2}$. Replace x, y, z with their expressions in terms of the parameter t, set equal to d and solve for t:
[tex]\sqrt{(t+1-1)^2+ (2t)^2+ (t+1-1)^2}= \sqrt{4t^2}= 2|t|= d[/itex]
There are two solutions because there are two such points, one on either side of (1, 0, 1).