Polar Coordinates Converter — Theory
1. Cartesian and polar coordinates
A point in the plane can be described in Cartesian form as
\[
(x,y).
\]
The same point can also be described in polar form as
\[
(r,\theta),
\]
where \(r\) is the distance from the origin and \(\theta\) is the angle measured from the positive
\(x\)-axis.
2. Polar to Cartesian conversion
If a point has polar coordinates \((r,\theta)\), then the right-triangle component formulas give
\[
x=r\cos\theta,
\qquad
y=r\sin\theta.
\]
These are the horizontal and vertical components of a vector with length \(r\).
3. Cartesian to polar conversion
If a point has Cartesian coordinates \((x,y)\), then the radius is found by the Pythagorean theorem:
\[
r=\sqrt{x^2+y^2}.
\]
The angle satisfies
\[
\tan\theta=\frac{y}{x},
\]
but the quadrant matters. For that reason, the best angle formula is
\[
\theta=\operatorname{atan2}(y,x).
\]
4. Why \(\operatorname{atan2}(y,x)\) is important
The ordinary expression \(\arctan(y/x)\) can lose quadrant information.
For example, the points \((1,1)\) and \((-1,-1)\) both have \(y/x=1\), but they lie in different
quadrants.
The function \(\operatorname{atan2}(y,x)\) uses both signs and returns the correct quadrant angle.
5. Principal angle conventions
An angle can be represented in many equivalent ways because adding a full turn gives the same direction:
\[
\theta\equiv\theta+2k\pi,
\qquad k\in\mathbb Z.
\]
Two common principal angle intervals are
\[
(-\pi,\pi]
\]
and
\[
[0,2\pi).
\]
In degrees, these are
\[
(-180^\circ,180^\circ]
\qquad\text{and}\qquad
[0^\circ,360^\circ).
\]
6. Coterminal polar coordinates
The coordinates
\[
(r,\theta)
\]
and
\[
(r,\theta+2k\pi)
\]
represent the same point for every integer \(k\).
7. Negative radius representation
Polar coordinates also allow a negative radius. A negative radius points in the opposite direction.
Therefore,
\[
(r,\theta)\equiv(-r,\theta+\pi).
\]
For example,
\[
(3,30^\circ)\equiv(-3,210^\circ).
\]
8. Worked example: \(r=5,\ \theta=\pi/3\)
Start with
\[
r=5,
\qquad
\theta=\frac{\pi}{3}.
\]
Use the conversion formulas:
\[
x=r\cos\theta,
\qquad
y=r\sin\theta.
\]
Since
\[
\cos\frac{\pi}{3}=\frac{1}{2},
\qquad
\sin\frac{\pi}{3}=\frac{\sqrt3}{2},
\]
we get
\[
x=5\cdot\frac{1}{2}=\frac{5}{2}=2.5,
\]
and
\[
y=5\cdot\frac{\sqrt3}{2}
=
\frac{5\sqrt3}{2}
\approx4.33.
\]
9. Worked example: \((x,y)=(3,4)\)
Start with
\[
x=3,
\qquad
y=4.
\]
The radius is
\[
r=\sqrt{3^2+4^2}=\sqrt{25}=5.
\]
The angle is
\[
\theta=\operatorname{atan2}(4,3).
\]
Numerically,
\[
\theta\approx0.9273\text{ radians}
\approx53.13^\circ.
\]
11. Common mistakes
- Using degrees as radians: always check the selected angle unit.
- Ignoring the quadrant: \(\arctan(y/x)\) alone may give the wrong angle.
- Forgetting coterminal angles: \(\theta\) and \(\theta+2\pi\) point in the same direction.
- Rejecting negative radius: negative \(r\) is allowed in polar coordinates.
- Expecting a unique angle at the origin: when \(r=0\), every angle gives the origin.
- Mixing principal intervals: \((-\pi,\pi]\) and \([0,2\pi)\) can give different-looking but equivalent angles.