[Math] How to find a point a given distance from another point along a line

geometry

I have $(x_1, y_1), (x_2, y_2)$.

How do I find the point that's $d$ distance away from $(x_1, y_1)$ on a straight line to $(x_2, y_2)$?

I know I can get the length of the line with Pythagoras. I know if I drew a circle I could use the radius as distance and the point would be where the line and the circle intersect.

Could someone briefly explain each step to me please?

I don't understand Finding a point along a line a certain distance away from another point!

Best Answer

If I can move one unit along a line I can move any distance along that line. We'll calculate how much we would have to add to each of $x_1$ and $y_1$ to move one unit along the line and then we'll multiply that by $d$ to get the answer.

Let $d^{\prime}$ be the distance between $(x_1,y_1)$ and $(x_2,y_2)$. It's value is $$d^{\prime}=\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}$$

If we move from $(x_1,y_1)$ to $(x_2,y_2)$ along the line connecting them we move $d^{\prime}$ units. We can represent this by the function

$$(x_1,y_1)\mapsto (x_1+(x_2-x_1),y_1+(y_2-y_1))$$

To move one unit along the same line, we divide the amount of the change by $d^{\prime}$ to get

$$(x_1,y_1)\mapsto (x_1+\frac{1}{d^{\prime}}(x_2-x_1),y_1+\frac{1}{d^{\prime}}(y_2-y_1))$$

Finally, to move a distance $d$ along the line we multiply the change by $d$ to get

$$(x_1,y_1)\mapsto (x_1+\frac{d}{d^{\prime}}(x_2-x_1),y_1+\frac{d}{d^{\prime}}(y_2-y_1))$$

Related Question