Michael D. answered 07/07/24
PhD in Math with 20+ Years Teaching Experience at the University Level
The other answer (from Mark M.) is a little misleading (or perhaps incomplete). For a + bi in rectangular/Cartesian coordinates, you have:
r2 = a2 + b2
The usual convention is to use a non-negative value of r (but this isn't required, polar forms are not unique!), so take the positive square root. Assuming r > 0:
tan(θ) = b/a
...but this IS NOT EQUIVALENT to θ = arctan(b/a) in general; only when -π/2 < θ < π/2 [between -90 and 90, if working in degrees rather than radians]. If a < 0, which is the case here, you need to adjust θ by either adding or subtracting π [180 degrees] so that the final value θ is in Quadrant II (when b > 0) or Quadrant III (when b < 0).
Whether you should add or subtract depends on the problem/application; Mark's answer assumes θ from 0 to 2π (which is very common) but in some cases you want θ from -π to π (in which case you would instead subtract 180 degrees).
Michael D.
07/07/24