GNU Octave Manual Version 3by John W. Eaton, David Bateman, Søren Hauberg Paperback (6"x9"), 568 pages ISBN 095461206X RRP £24.95 ($39.95) |

## 17.2 Complex Arithmetic

The following functions are available for working with complex
numbers. Each expects a single argument. Given a matrix they work on
an element by element basis. In the descriptions of the following
functions,
`z` is the complex number `x` + `i``y`, where `i` is
defined as `sqrt (-1)`

.

__Mapping Function:__**abs***(*`z`)- Compute the magnitude of
`z`, defined as |`z`| =`sqrt (x^2 + y^2)`

.For example,

abs (3 + 4i) => 5

__Mapping Function:__**arg***(*`z`)__Mapping Function:__**angle***(*`z`)- Compute the argument of
`z`, defined as`theta`=`atan (`

.`y`/`x`)in radians.

For example,

arg (3 + 4i) => 0.92730

__Mapping Function:__**conj***(*`z`)- Return the complex conjugate of
`z`, defined as`conj (`

=`z`)`x`-`i``y`.See also real, imag

__Mapping Function:__**imag***(*`z`)- Return the imaginary part of
`z`as a real number.See also real, conj

__Mapping Function:__**real***(*`z`)- Return the real part of
`z`.See also imag, conj

ISBN 095461206X | GNU Octave Manual Version 3 | See the print edition |