Next: Conversions, Previous: Integer Truncation, Up: Arithmetic [Contents][Index]

### 7.3 Complex Number Functions

The `J` (`calc-conj`) [`conj`] command computes the complex conjugate of a number. For complex number ‘`a+bi`’, the complex conjugate is ‘`a-bi`’. If the argument is a real number, this command leaves it the same. If the argument is a vector or matrix, this command replaces each element by its complex conjugate.

The `G` (`calc-argument`) [`arg`] command computes the “argument” or polar angle of a complex number. For a number in polar notation, this is simply the second component of the pair ‘`(`r`;`theta`)`’. The result is expressed according to the current angular mode and will be in the range -180 degrees (exclusive) to +180 degrees (inclusive), or the equivalent range in radians.

The `calc-imaginary` command multiplies the number on the top of the stack by the imaginary number ‘`i = (0,1)`’. This command is not normally bound to a key in Calc, but it is available on the `IMAG` button in Keypad mode.

The `f r` (`calc-re`) [`re`] command replaces a complex number by its real part. This command has no effect on real numbers. (As an added convenience, `re` applied to a modulo form extracts the value part.)

The `f i` (`calc-im`) [`im`] command replaces a complex number by its imaginary part; real numbers are converted to zero. With a vector or matrix argument, these functions operate element-wise.

The `v p` (`calc-pack`) command can pack the top two numbers on the stack into a composite object such as a complex number. With a prefix argument of -1, it produces a rectangular complex number; with an argument of -2, it produces a polar complex number. (Also, see Building Vectors.)

The `v u` (`calc-unpack`) command takes the complex number (or other composite object) on the top of the stack and unpacks it into its separate components.

Next: Conversions, Previous: Integer Truncation, Up: Arithmetic [Contents][Index]