Angle from point in a circumference An elementary question on geometry and trigonometry.
I have a circumference defined by radius $r$ and center $c$. I can draw the circumference with equations:
$$
\left\{
  \begin{array}{ll}
    x = \cos(\theta) * r + x_c \\
    y = \sin(\theta) * r + y_c
  \end{array}
\right.
$$
Where $\theta$ goes from $0$ to $2\pi$
Let say I have a point $p_1$ and I know that it lays in the circumference, I need to find out which $\theta$ generated it.
The first answer I can imagine is considering the inverse of cosine:
$$ \theta = \arccos \left( \frac{x_{p_1} - x_c}{r} \right) $$
But due to the fact that the output range of $\text {arccos}$ it $0 \leq y \leq \pi$ this formula is valid only for points $p_1$ that lay only on the first half of the circumference.
How to get a consistent formula valid for all angles?
 A: Let $P(x, y)$ be a point on the circle with center $C(x_c, y_c)$ and radius $r$.  Then, as you observed, 
\begin{align*}
x & = x_c + r\cos\theta\\
y & = y_c + r\sin\theta
\end{align*}
where $0 \leq \theta < 2\pi$ is the angle indicated in the diagram.

Solving for $\cos\theta$ yields
$$\cos\theta = \frac{x - x_c}{r}$$
Solving for $\sin\theta$ yields
$$\sin\theta = \frac{y - y_c}{r}$$
By definition, if $\theta$ is an angle in standard position (vertex at the origin, initial side on the positive $x$-axis), then $\cos\theta$ is the $x$-coordinate of the point where the terminal side of the angle intersects the unit circle and $\sin\theta$ is the $y$-coordinate of the point where the terminal side of the angle intersects the unit circle.  
Observe that if $\sin\theta \geq 0$, then $0 \leq \theta \leq \pi$.  In this case,
$$\theta = \arccos\left(\frac{x - x_c}{r}\right)$$
However, if $\sin\theta < 0$, then $\pi < \theta < 2\pi$, so $\theta$ does not lie in the range of the arccosine.  Thus, we must find the other angle in the interval $[0, 2\pi)$ that has the same cosine as 
$$\varphi = \arccos\left(\frac{x - x_c}{r}\right)$$

By symmetry, $\cos\theta = \cos\varphi$ if $\varphi = \pm \theta$.  Any angle coterminal with these angles will also have the same cosine.
$$\cos\theta = \cos\varphi \implies \theta = \pm \varphi + 2k\pi, k \in \mathbb{Z}$$
In particular, if $0 \leq \varphi < \pi$, then $\theta = 2\pi - \varphi$ has the same cosine and $\pi \leq \theta \leq 2\pi$, with the second equality holding if and only if $\varphi = 0$, which cannot be the case if $\sin\theta < 0$.     
Thus, if $\sin\theta < 0$, then
$$\theta = 2\pi - \varphi = 2\pi - \arccos\left(\frac{x - x_c}{r}\right)$$ 
