Euler's identity in three lines
c := cmplx.Exp(1i * math.Pi)
fmt.Println(c) // ~(-1+0i)
fmt.Println(cmplx.Abs(c)) // 1
math/cmplxElementary functions on the complex128 type: Abs, Exp, Log, Sqrt, Phase, trig.
c := cmplx.Exp(1i * math.Pi)
fmt.Println(c) // ~(-1+0i)
fmt.Println(cmplx.Abs(c)) // 1
z := complex(3, 4)
fmt.Println(cmplx.Abs(z), cmplx.Phase(z)) // 5, atan2(4,3)