# The real and imaginary parts of a complex number: re real im imag

### 5.10.2 The real and imaginary parts of a complex number: re real im imag

The re (or real) and im (or imag) commands find the real and imaginary parts of a complex number.

The re command finds the real part of a complex number.
real is a synonym for re.

- re takes one argument:
  a, a complex number (or point).
- re(a) returns the real part of the complex number a (or the projection of the point a onto the x axis).

#### Example.

Input:

re(3+4*i)

Output:

3

The im command finds the imaginary part of a complex number.
imag is a synonym for im.

- im takes one argument:
  a, a complex number (or point).
- im(a) returns the imaginary part of the complex number a (or the projection of the point a onto the y axis).

#### Example.

Input:

im(3+4*i)

Output:

4