0
$\begingroup$

I have a vector $(x,y) = (x_2 - x_1, y_2 - y_1)$. I have an arrow pointing to 0 degrees.

With vector $(x, y)$, how can I find the number of degrees (0 - 360) that will be the direction the arrow points in order for it to point from $v_1 = (x_1, y_1)$ to $v_2 = (x_2, y_2)$?

$\endgroup$
1
$\begingroup$

I am assuming that the arrow 'pointing to 0°' is pointing in $x$-direction of the coordinate system.

Then $\frac{y}{x} = \tan(\alpha-180°)$ where $\alpha$ is the angle you are looking for, because the vector $(x,y)$ is poiting from $v_2$ to $v_1$. That means $y/x$ is the slope of the line that goes throu $v_1$ and $v_2$. But you want the other direction thats why you have to substract (or add) 180°.

$\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.