The modulus and argument of a complex number: abs arg

### 6.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 6.16.2).

- abs takes one argument:
  z, a complex number.
- abs(z) returns the modulus |z|.

Example.
Input:

abs(3+4*i)

Output:

5

The arg command finds the argument of a complex number.

- arg takes one argument:
  z, a complex number.
- arg(z) returns the principal value of the argument of z.

Examples.

- Input:
  arg(3+4*i)
  Output:

  arctan | ⎛ ⎜ ⎜ ⎝ |
  4
  3
  | ⎞ ⎟ ⎟ ⎠

- Input:
  arg(3.0+4.0*i)
  Output:

  0.927295218002