converting between cartesian and polar coordinates

The Cartesian coordinate system specifies a point by the projection of its position to a set of orthogonal axes. Visually,

The polar coordinate system specifies a point by its distance from the pole and deviation from the polar axis. Visually,

Suppose that the coordinates (x,y) and (r,θ) represent the same point P.
By convention, let the Cartesian origin O be the same as the polar pole O, and let L be in the same relative orientation as the positive x-axis.
Then we can construct the right triangle

which can be analyzed with trigonometric functions and the Pythagorean theorem to produce the identities

x2+y2=r2cos(θ)=xrtan(θ)=yxsin(θ)=yr

which can be rewritten

r=x2+y2x=rcos(θ)θ=arctan(yx)y=rsin(θ)

such that if I am given coordinates (x,y), I can convert to (r,θ) with the first column identities,
and if I am given coordinates (r,θ), I can convert to (x,y) with the second column identities.


Powered by Forestry.md