Polar returns the absolute value r and phase θ of x, such that x = r * e**θi. The phase is in the range [-Pi, Pi].
package main import ( "fmt" "math" "math/cmplx" ) func main() { r, theta := cmplx.Polar(2i) fmt.Printf("r: %.1f, θ: %.1f*π", r, theta/math.Pi) }