Polar to Cartesian Conversion Formulas
x = r cos Θ
y = r sin Θ
Converting from Cartesian is more or less easy. Let's first notice the subsequent.
x2 + y2 = (r cosΘ)2 + (r sinΘ)2
= r2 cos2 Θ + r2 sin2 Θ
= r2 (cos2 Θ + sin2 Θ) = r2
This is a very helpful formula that we should keep in mind, though we are after an equation for r so let's take the square root of both sides. This provides,
r = √x2 + y2
Note: Technically we should have a plus or minus in front of the root as we know that r can be either positive or negative. We will run along with the convention of positive r here.
Getting an equation for Θ is approximately as simple. We'll begin with,
y/x = r sinΘ / r cos Θ = tan Θ
Taking the inverse tangent of both of the sides gives,
Θ = tan-1 (y/x)
We will require to be careful with this as inverse tangents only return values in the range - Π/2 < Θ < Π/2. Remind that there is a second possible angle and that the second angle is provided by Θ + Π.
After that Summarizing gives the subsequent formulas for transforming from Cartesian coordinates to polar coordinates.
Cartesian to Polar Conversion Formulas
r2 = x2 + y2
r = √ (x2 + y2)
Θ = tan -1 (y/x)