When do you add $180$ to the directional angle? When finding the direction angle with the formula $\theta = \tan^{-1} \left(\frac{y}{x}\right )$, when do you add $180$ degrees to the answer? Is it whenever the $x$ is negative, when the angle is in the third or fourth quadrant (if this is the case, how would I know the angle is there?), or just in the third quadrant (if this is the case, how would I know the angle is there)? Or something else entirely?
 A: If you look at this table in the Wikipedia article, you will see that in the arctangent row, the "range of usual principal value" is given as $-90^\circ<y<90^\circ$.
This means that if you give a number to the arctangent function, most calculators respond with an answer between $-90^\circ$ and $90^\circ$. This is the half-plane on the right, quadrants I and IV, so $x$ is assumed positive.
If $x$ is negative, the answer you want is $180^\circ$ away.
A: Andrew Woods' answer is correct, but let me offer another way to compute $\theta$.
As shown in this answer,
$$
\begin{align}
\tan(\theta/2)
&=\frac{\sin(\theta)}{1+\cos(\theta)}\\
&=\frac{\frac yr}{1+\frac xr}\\[3pt]
&=\frac{y}{x+r}
\end{align}
$$
which leads to the formula
$$
\bbox[5px,border:2px solid #C0A000]{\theta=2\arctan\left(\vcenter{\frac y{x+\sqrt{x^2+y^2}}}\right)}
$$
which is valid as long as $x+\sqrt{x^2+y^2}\ne0$; that is, $y\ne0$ or $x\gt0$.

Verification
Since $\tan(2x)=\frac{2\tan(x)}{1-\tan^2(x)}$,
$$
\begin{align}
\tan(\theta)
&=\frac{2\frac y{x+\sqrt{x^2+y^2}}}{1-\left(\frac y{x+\sqrt{x^2+y^2}}\right)^2}\\
&=\frac{2y\left(x+\sqrt{x^2+y^2}\right)}{2x^2+2x\sqrt{x^2+y^2}}\\[12pt]
&=\frac yx
\end{align}
$$
