Compute the phase angle in radians of a complex number z


julia> angle(2 + 2im)

This example calculates the phase angle in radians of the complex number 2 + 2im.

julia> angle(-1 + im)

Here, the angle function is used to find the phase angle of the complex number -1 + im in radians.

julia> angle(0 + 1im)

The angle function can also be used with pure imaginary numbers. This example returns the phase angle of 0 + 1im in radians.

Common mistake example:

julia> angle(0)
DomainError with 0.0:
angle will only return NaN for complex numbers with zero imaginary part.

In this example, the angle function is used with a real number 0. The function expects a complex number, so passing a real number will result in a DomainError.

See Also

all, all!, angle, any, any!, falses, ifelse, is, isinf, isinteger, isnan, isperm, ispow2, isreal, trues,

User Contributed Notes

Add a Note

The format of note supported is markdown, use triple backtick to start and end a code block.

*Required Field

Checking you are not a robot: