[Math] How to find the angle a vector makes to the $+x$ axis

vectors

You are given two vectors $\vec a = -3.00\hat i + 7.00\hat j$ and $\vec b= 4.00\hat i + 2.00\hat j$. Let the counterclockwise angles be positive.

What angle $\theta (\vec a)$ where $0^\circ \le \theta (\vec a) < 360^\circ $, does $\vec a$ make with the $+x$-axis?

I drew a right triangle with a $\vec ax$ component of $-3$ and an $\vec ay$ component of $7$. Do I just use trig to find the angle off the $x$-axis?

Best Answer

A general rule for finding the counterclockwise angle from the positive $x$ axis to the direction of a two-dimensional vector is explained in How to convert components into an angle directly (for vectors)?

The basic idea is that you first take the arc tangent of the $y$-component divided by the $x$-component: $$ \theta_1 = \arctan\frac{a_y}{a_x}. $$

One complication is that this procedure gives the same resulting $\theta_1$ for the vector $\langle a_x,a_y \rangle$ and the vector $\langle -a_x,-a_y \rangle,$ which are two vectors in directions $180$ degrees apart. So $\theta_1$ may be in the direction you want, or in the direction $180$ degrees opposite.

In fact $\theta_1$ will be in the correct direction whenever $a_x > 0,$ since that is how the arc tangent function is designed to work. (It always produces angles in the range $-\frac\pi2$ to $\frac\pi2$ radians, that is, $-90$ to $90$ degrees, which correspond to vectors with positive $x$-components.)

The cases where $\theta_1$ is wrong are precisely the cases where $a_x < 0,$ so if $a_x < 0$ (as it is in your particular question) you have to add $180$ degrees to $\theta_1.$

A second complication (which does not actually come up in your particular question) occurs because the procedures given above produce a result in the range $-90$ degrees to $270$ degrees, but people usually want an answer in the range $-180$ to $180$ or $0$ to $360.$ The solution to this, of course, is to add or subtract $360$ degrees as needed to get an answer in the desired angle range.