0
$\begingroup$

I have a line $AB$ and a point $C$. I need to find point $D$ on line $AB$ at a distance $r$ from point $C$, how can I find point $D$? and is there a general formula to calculate this?

Coordinates of points $A, B, C$ are known.

$\endgroup$
  • $\begingroup$ @Vikram sorry, i made a typo, i meant to write: how can i find point D $\endgroup$ – FrankK Oct 5 '17 at 7:38
  • $\begingroup$ do you have the coordinates of A and B? $\endgroup$ – Vikram Oct 5 '17 at 7:40
  • $\begingroup$ @Vikram yes, they are known $\endgroup$ – FrankK Oct 5 '17 at 7:42
  • $\begingroup$ could you write this in an answer? $\endgroup$ – FrankK Oct 5 '17 at 7:46
0
$\begingroup$

First, you have to realize that there are three cases:

  • Either the distance $r$ is inferior to the distance between $C$ and $AB$ and in that case you have no such point D

  • Or the distance $r$ is equal to the distance between $C$ and $AB$. In that case you have one solution

  • Or the $r$ is greater than the distance between $C$ and $AB$ and then you have two solutions

Already you can see that it looks that it will be like solving a polynomila of second degree.

Let's say $C(x_C,y_C)$ and $AB$ have the following equation $y=ax+b$.

Then $D(x_D,y_D)$, being on $AB$, follows $y_D=ax_D+b$ (equation 1)

Distance $CD$ is $CD=\sqrt{(x_C-x_D)^2+(y_C-y_D)^2}=r$ (equation 2)

Or $(x_C-x_D)^2+(y_C-y_D)^2=r^2$

$(x_C-x_D)^2+(y_C-ax_D-b)^2=r^2$ (after using equation 1) which is a quadratic equation for $x_D$...

I think you can take it from here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.