0
$\begingroup$

A line draw between $(x_1,y_1)$ to $(x_2,y_2)$. I need to find the ending point in which the line is extended by $D$ distance(or length).

See this image for clarity

From the above image, $(x_1,y_1)$,$(x_2,y_2)$ and $D$ is known, I need to find $(x_3,y_3)$.

$\endgroup$

3 Answers 3

0
$\begingroup$

Welcome to MSE. One way to express the location of $(x_3, y_3)$ is as $\langle x_2, y_2 \rangle + D \cdot \langle u, v \rangle $, where $\langle u, v\rangle$ is the unit vector pointing in the direction of $\langle x_2, y_2 \rangle - \langle x_1, y_1 \rangle$

$\endgroup$
0
$\begingroup$

Define the unit vector from $(x_1, y_1)$ to $(x_2, y_2)$ as follows

$ v = \dfrac{ (x_2 - x_1, y_2 - y_1) }{L}$

where $L = \sqrt{ (x_2 - x_1)^2 + (y_2 - y_1)^2 } $

Then

$(x_3, y_3) = (x_1, y_1) + (L+D) v $

or equivalently,

$(x_3, y_3) = (x_2, y_2) + D v $

$\endgroup$
3
  • $\begingroup$ I have a small doubt, (𝑥3,𝑦3)=(𝑥1,𝑦1)+(𝐿+𝐷)𝑣=(𝑥2,𝑦2)+𝐷𝑣 in the above equation why do you put two assignmet symbol on same line. $\endgroup$
    – trojancode
    Commented May 9, 2022 at 11:27
  • $\begingroup$ Because they are equal to each other. $\endgroup$
    – Quadrics
    Commented May 9, 2022 at 11:48
  • $\begingroup$ I'll edit the solution to make it clearer. $\endgroup$
    – Quadrics
    Commented May 9, 2022 at 12:23
-1
$\begingroup$

The line through $(x_1, y_1)$ and $(x_1, y_2)$ can be written $y= \frac{y_2-y_1}{x_2-x_2}(x- x_2)+ y_2$.

The circle with center at $(x_2, y_2)$ and radius D can be written $(x-x_2)^2+ (y-y_2)^2= D^2$.

$(x_3, y_3)$, the endpoint of the line segment extended from $(x_2, y_2)$ by distance D is where that line and circle intersect so we must have $(x_3- x_2)^2+ (\frac{y_2-y_1}{x_2-x_2}(x_3- x_2))^2= D^2$.

Solve that quadratic equation for $x_3$ and then use the equation of the line to find $y_3$.

(That equation will have two roots. You want the one on the other side of $x_2$ from $x_1$.)

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .