-2

I have a point $(x_1, y_1)$, distance $d$ and a slope $m$ of line $l$.

Now I wanna find another point $(x_2, y_2)$ that's $d$ distance away from $(x_1, y_1)$.

Point $(x_1, y_1), (x_2, y_2)$ are both on the line $l$.

I found some similar questions but I didn't understand it, and none of them worked with the line slope Finding a point along a line a certain distance away from another point!

2 Answers2

1

Slope $m$ means that $\frac{y_2-y_1}{x_2-x_1}=m$. This gives You one equation. Another equation comes from $(y_2-y_1)^2+(x_2-x_1)^2=d^2$. Two equations for two variables - You only have to solve the system. It is not very easy in general form, but if $m$ and $d$ are given as numbers it's simple. You have from the first equation: $y_2=y_1+m(x_2-x_1)$, You can insert this in the second one. The result is $(m^2+1)(x_2-x_1)^2=d^2$. From here You can find $x_2$ and then $y_2$.

0

One (possibly not the simplest) way is as follows:

Write parametric equations for your line $\ell$: $$ x=x_1+lt,\qquad y=y_1+mt $$ where $(l,m)$ is a vector parallel to $\ell$ (to find it, just take any point $(\bar x,\bar y)$ on $\ell$ and let $l=\bar x-x_1$, $m=\bar y-y_1$).

Then renormalize $(l,m)$ so that $l^2+m^2=1$.

Done that, the points you are looking for are those corresponding to the value of the parameter $t=\pm d$.

Andrea Mori
  • 26,969