Previous Up Next

5.10.4 The modulus and argument of a complex number: abs arg

A complex number z can be written in polar form reiθ, where r is the modulus and θ is the argument. The angle θ is only determined up to a multiple of 2π; there will be a unique value in the interval (−π,π], the value in this interval is called the principal value of the argument.

The abs and arg commands find the modulus and argument of a complex number.

The abs command finds the modulus of a complex number (see also Section 5.16.2).

Example

Input:

abs(3+4*i)

Output:

5


The arg command finds the argument of a complex number.

Examples


Previous Up Next