It is all a matter of definition!
If (a,b) is a point on the ray that defines the angle \(\displaystyle \phi\), the ray other than the positive x-axis, then these are the definitions:
\(\displaystyle \L r= \sqrt {a^2 + b^2 } \quad \Rightarrow \quad \cos \left( \phi \right) = \frac{a}{r} \le 1\).