The phase of a complex number is the angle between it and the positive real axis, with the orientation being so that small positive angles have positive imaginary part. This is known as the argument.

If you express a complex number as

A(Cos(θ) + i Sin(θ))

or

A e^iθ

and A > 0, then θ is the complex phase of the number.

Given a complex number of the more common form

a + i b

then the complex phase is

Im(ln(a + ib))

which works straightforwardly. If that is unavailable,

atan(a/b)... except that if a < 0, you need to flip halfway around the circle (add π radians)

In some cases it is useful to allow the complex phase to vary over a larger range than 2π. In this case, you can't just get the complex phase from the number!