0
$\begingroup$

I have two given points (in 2D) $A$ and $B$ and I would like to compute the coordinates of point $C$ located at a particular distance $d$ (also given) from A and in the direction of $\vec{AB}$. Is there a quicker and smarter way to do that than to try to solve: $$(x_C-x_A)^2+(y_C-y_A)^2=d^2$$ $$x_A(y_C-y_B)+x_B(y_C-y_A)+x_C(y_A-y_B)=0$$ and then choosing the solution of the quadratic equation that corresponds to the point in the direction of $\vec{AB}$ ?

$\endgroup$
0
$\begingroup$

You may use unit vectors. Let $\hat{\mathbf{p}}$ be a unit vector along $\overrightarrow{AB}$ and $d$ be the given distance. Then $\overrightarrow{AC} = \pm d \, \hat{\mathbf{p}}$. Using the formula $\overrightarrow{AC}=\overrightarrow{OC}-\overrightarrow{OA}$ allows us to get the required position vector (and hence coordinates).

$\endgroup$
  • $\begingroup$ Ah, yes, that's way simpler. Thanks. I should have thought about normalising $\vec{AB}$ and then calculating the coordinates of C based on that. $\endgroup$ – Tamori Feb 19 '15 at 13:05

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.