Conversion between Cartesian and Polar Coordinates in Plane

Theorem
Let $S$ be the plane.

Let a cartesian plane $C$ be applied to $S$.

Let a polar coordinate plane $P$ be superimposed upon $C$ such that:


 * $(1): \quad$ The origin of $C$ coincides with the pole of $P$.


 * $(2): \quad$ The $x$-axis of $C$ coincides with the polar axis of $P$.

Let $p$ be a point in $S$.

Let $p$ be specified as $p = \left\langle{r, \theta}\right)$ expressed in the polar coordinates of $P$.

Then $p$ is expressed as $\left({r \cos \theta, r \sin \theta}\right)$ in $C$.

Contrariwise, let $p$ be expressed as $\left({x, y}\right)$ in the cartesian coordinates of $C$.

Then $p$ is expressed as:
 * $p = \left\langle{\sqrt {x^2 + y^2}, \arctan \dfrac y x + \pi \left[{x < 0 \text{ or } y < 0}\right] + \pi \left[{x > 0 \text{ and } y < 0}\right]}\right\rangle$

where:
 * $\left[{\, \cdot \,}\right]$ is Iverson's convention.
 * $\arctan$ denotes the arctangent function.