0
$\begingroup$

In case one want to calculate $\alpha$ angle between $AB$ vector and $x$ axis, it can calculate $\alpha=arctan2(x_1-x_0,y_1-y_0)$. Thus, for example for $A(0,0)$ and $B(10,10)$ one will get $\alpha$ equal to 45°. Is there a way to calculate $x_1,y_1$ coordinates when $\alpha$ angle and $x_0,y_0$ are given?

enter image description here

$\endgroup$
  • $\begingroup$ You need also the distance $AB$. $\endgroup$ – Emilio Novati Mar 11 '16 at 18:15
  • $\begingroup$ Say, it is known and we can call it as $z$. $\endgroup$ – bluevoxel Mar 11 '16 at 18:16
1
$\begingroup$

If we know the distance $AB=r$ than we have: $$ x_1=x_0+r\cos \alpha \qquad y_1=y_0+r \sin \alpha $$

$\endgroup$
  • $\begingroup$ It is worth to mention that $\alpha$ has to be in radians. $\endgroup$ – bluevoxel Mar 11 '16 at 18:40
  • $\begingroup$ No matter! $\alpha$ cam be in radians or degree, anyway $\cos \alpha$ and $\sin \alpha$ have one well defined value for given $\alpha$. $\endgroup$ – Emilio Novati Mar 11 '16 at 19:01
  • $\begingroup$ Sorry, but I'm a programmer, so I have a little bit distorted way of thinking. For my needs I had to convert degrees to radians, in order to get accurate coordinates on the screen. But you are right. Thanks a lot. $\endgroup$ – bluevoxel Mar 11 '16 at 19:09

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.