# linear interpolation in 3 dimensions

Say that I have 2 points in 3 dimensional space specified in Euclidean coordinates $p_0(x_0,y_0,z_0)$ and $p_1(x_1,y_1,z_1)$. How would I go about finding the coordinates of an unknown point that lies on the line segment from $p_0$ to $p_1$ that is a known Euclidean distance $d$ from $p0$?

-
How about an intersection of sphere with radius d, and the line segment. (but this is probably not the easiest solution) –  tp1 Feb 3 '12 at 19:44

$$v=p_1-p_0=(x_1-x_0,y_1-y_0,z_1-z_0)=(x,y,z)$$
now since you know the total distance between $p_0$ and $p_1$ (which is $\|v\|$) and the distance to your $p_d$ (which is just $d$):
$$p_d=(x_d,y_d,z_d)=p_0+\frac{d}{\|v\|}v$$