SZanlongo
5/31/2017 - 11:33 PM

Point along line given two points From: https://math.stackexchange.com/q/83404

Point along line given two points

From: https://math.stackexchange.com/q/83404

Find a point along a line segment in three-dimensional space, given two points.

For example: Find a point along a line segment between point $a(-2, -2, -2)$ and $b(3, 3, 3)$ which is at distance $3$ from point $a$, in the direction of point $b$.

Begin by creating a vector $\mathbf{\overrightarrow{\text{BA}}}$ by subtracting $\mathbf{A}$ from $\mathbf{B}$: $\langle 3, 3, 3 \rangle - \langle -2, -2, -2 \rangle = \langle 5, 5, 5 \rangle$. Then, normalize this vector by dividing $\mathbf{\overrightarrow{\text{BA}}}$ by its length, $ \frac{\mathbf{\overrightarrow{\text{BA}}}}{\lVert \mathbf{\overrightarrow{\text{BA}}} \rVert} = \frac{\langle 5, 5, 5 \rangle}{\sqrt{52+52+5^2}} = \langle 0.577, 0.577, 0.577 \rangle$. This new unit vector can then be scaled and added to $\mathbf{A}$ to find the point in space at the desired distance. In this case: $\mathbf{A} + 3\langle 0.577, 0.577, 0.577 \rangle = \langle -0.268, -0.268, -0.268 \rangle$.