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 = \polar {r, \theta}$ expressed in the polar coordinates of $P$.

Then $p$ is expressed as $\tuple {r \cos \theta, r \sin \theta}$ in $C$.

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

Then $p$ is expressed as:
 * $p = \polar {\sqrt {x^2 + y^2}, \arctan \dfrac y x + \pi \sqbrk {x < 0 \text{ or } y < 0} + \pi \sqbrk {x > 0 \text{ and } y < 0} }$

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