### 7.4.4 Modulus and argument of a complex number

A complex number z can be written in polar form r eiθ, 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, respectively (see also Section 8.3.2).

- abs takes z, a complex number.
- abs(z) returns the modulus |z|.
- arg takes z, a complex number.
- arg(z) returns the principal value of the argument of z.

#### Examples

abs(3+4*i)

5 |  |  |  |  |  |  |  |  |  |

arg(3+4*i)

arctan

⎛
⎜
⎜
⎝

4
3

⎞
⎟
⎟
⎠

arg(3.0+4.0*i)

0.927295218002 |  |  |  |  |  |  |  |  |  |