# calculate angle of line with negative slope

I want to use the formula $$tan(\alpha)=m$$ for negative slopes but always get negative degrees. For instance, say the slope of a line $$g$$ is $$-1$$. Using the formula above (arctan$$(-1)=\alpha$$), I get $$-45$$ degrees instead of $$135$$ degrees. Why exactly does this formula not returning correct angles for negative slopes?

• It all depends on how you define $\arctan$. It is usually defined as the inverse function of the restriction of $\tan$ on $\left( -\frac{\pi}{2}, \frac{\pi}{2}\right)$. – Bill O'Haran Dec 18 '18 at 10:12

Use this formula: $$\alpha=\begin{cases}\tan^{-1}m,&m\ge0\\\pi+\tan^{-1}m,&m<0\end{cases}$$