Conversion between Cartesian and Polar Coordinates in Plane

Theorem
Let $S$ be the plane.

Let a Cartesian plane $\CC$ be applied to $S$.

Let a polar coordinate plane $\PP$ be superimposed upon $\CC$ such that:


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


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

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

Let $p$ be specified as $p = \polar {r, \theta}$ expressed in the polar coordinates of $\PP$.

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

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

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.

Proof
Let $P$ be a point in the plane expressed:


 * in Cartesian coordinates as $\tuple {x, y}$
 * in polar coordinates as $\polar {r, \theta}$.


 * Cartesian-polar-conversion.png

As specified, we identify:
 * the origins of both coordinate systems with a distinguished point $O$
 * the $x$-axis of $C$ with the polar axis of $P$.

Let a perpendicular $PM$ be dropped from $P$ to the $x$-axis.

The triangle $OMP$ is a right triangle:
 * whose hypotenuse is $OP$, whose length is $r$
 * whose legs are $OM$ and $MP$
 * whose angle $POM$ is $\theta$.

By definition of sine and cosine


 * $x = r \cos \theta$
 * $y = r \sin \theta$

The result follows.