Leverage the dot product. If $\vec a = (a_1,a_2,\dots,a_n)$ is any point, we have two ways to compute the dot product with any vector $\vec b=(b_1, b_2, \dots, b_n)$:
$\vec a \cdot \vec b = (a_1 b_1, a_2b_2, \dots, a_nb_n)$ $\vec a \cdot \vec b = \lVert \vec a \rVert \lVert \vec b \rVert \cos \theta$ where $\theta$ is the angle between $\vec a$ and $\vec b$ (the primary angle, i.e. $\theta \in [0,\pi]$). So now, taking $\vec b = - \hat i$ (a unit vector on the negative x-axis) we have that
$\theta = \arccos\left(\frac {\vec a \cdot \vec b} {\lVert \vec a \rVert \lVert \vec b \rVert}\right )$
Now by the first way of computing the dot product we have that $\vec a \cdot \vec b = -a_1$, and since $\lVert \vec b \rVert =1$ we have that $\theta = \arccos \left( \frac {-a_1} {\lVert \vec a \rVert} \right )\,.$
Now you mentioned that you wanted the clockwise angle in $\Bbb R ^2$, so you just need to add $\pi$ if $\vec a$ is below the x-axis, i.e. if $a_2<0$. The value $a_2/|a_2|$ is equal to the sign of $a_2$, so let's consider $\frac {1-a_2/|a_2|}{2}$ which will equal $1$ when $a_2<0$ and $0$ when $a_2>0$. Thus the function you want in total is just
$f(\vec a)=\arccos\left ( \frac {-a_1} {\lVert \vec a \rVert} \right )+\frac {1-a_2/|a_2|}{2} \pi $
(Note that the heading of your question, as well as the initial description, gives a much different impression of what you are looking for.)