1
$\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$
2
  • $\begingroup$ You need also the distance $AB$. $\endgroup$ Mar 11, 2016 at 18:15
  • $\begingroup$ Say, it is known and we can call it as $z$. $\endgroup$
    – bluevoxel
    Mar 11, 2016 at 18:16

1 Answer 1

2
$\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$
3
  • $\begingroup$ It is worth to mention that $\alpha$ has to be in radians. $\endgroup$
    – bluevoxel
    Mar 11, 2016 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$ Mar 11, 2016 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, 2016 at 19:09

You must log in to answer this question.

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