The imag() Command

The imag() command returns the imaginary component of a complex number, opposed to real(), which returns the real component.


Command Summary

Returns the imaginary component of a complex number.

Command Syntax

imag(value)

Menu Location

The command catalog.

Calculator Compatibility

This command works on all calculators.

Token Size

1 byte

This command takes a single complex number as an input, and returns the second (imaginary) component.

(Please note that in this example, 𝑖 denotes the imaginary unit, not the letter i.)

:(1.2,3.4𝑖)→z
:imag(z)
           3.4
:𝜋𝑖→c
:imag(c)
           𝜋

Advanced Uses

Storing two numbers as one variable

:2→a
:7→b
:(a+b𝑖)→z

:real(z)
           2
:imag(z)
           7

Error Conditions

Related Commands

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Noncommercial 2.5 License.