ReIm

ReIm[z]

gives the list {Re[z],Im[z]} of the number z.

Details

  • ReIm automatically threads over lists.

Examples

open allclose all

Basic Examples  (3)

The real and imaginary parts of a complex number:

Real numbers are a special kind of complex number:

ReIm[list] gives a list of ordered pairs:

Scope  (5)

ReIm accepts all number types:

ReIm works with symbolic representations of numbers:

Purely symbolic expressions can be partially simplified:

ReIm supports nested lists and ragged arrays:

ReIm works with SparseArray and structured array objects:

Applications  (3)

Use ReIm with ListPlot to visualize numbers in the complex plane:

Use ReIm with ParametricPlot to visualize complex-valued functions on the reals:

Use ReIm together with Epilog to pick out points in a complex-plane plot:

Properties & Relations  (9)

ReIm increases the depth of an array by one, adding a new inner dimension of length 2:

ReIm[array] gives an array of {re,im} pairs:

This can be turned into a pair {Re[array],Im[array]} using Transpose:

ComplexExpand assumes variables to be real:

In general, variables are assumed to be complex, which may prevent simplification:

Use Simplify and FullSimplify to simplify the results of ReIm:

ReIm converts complex numbers to pairs:

FromPolarCoordinates converts pairs of real-valued polar coordinates to pairs:

ReIm can be viewed as the composition of AbsArg and FromPolarCoordinates:

ReIm converts complex numbers to pairs:

AngleVector converts pairs of reals to pairs:

ReImPlot plots the real and imaginary parts of a function:

Use ComplexListPlot to plot complex numbers using their real and imaginary parts:

Possible Issues  (1)

Substituting a list l for z in the output of ReIm[z] is different from directly evaluating ReIm[l]:

For any array, the two results are related by a transposition of the inner and outer levels:

Introduced in 2015
 (10.1)