Complex

The Complex type provides support for working with complex numbers in Mathematics.NET.

Overview

Any complex number zz can be written in the form

z=x+iy,z = x + iy,

where xx and yy are real numbers and ii is the imaginary unit, which has the property i2=1i^2=-1. The set of complex numbers is denoted by C\mathbb{C}.1

Implements

  • Name
    IComplex{T}
    Type
    interface
    Description

    Defines support for complex numbers.

  • Name
    IDifferentiableFunctions{T}
    Type
    interface
    Description

    Defines support for common differentiable functions.


PROPERTYRe

Re

Get the real part of a complex number.

Return Type

  • Name
    result
    Type
    Real
    Description

    A real number.

Snippet

PROPERTY
Re
Complex z = new(1, 2);
z.Re;

Result

1

PROPERTYIm

Im

Get the imaginary part of a complex number.

Return Type

  • Name
    result
    Type
    Real
    Description

    A real number.

Snippet

PROPERTY
Re
Complex z = new(1, 2);
z.Re;

Result

2

PROPERTYMagnitude

Magnitude

Get the magnitude of a complex number.

Let z=x+iyz=x+iy, where xx and yy are real numbers and ii is the complex unit. The, the magnitude of zz, written as z|z|, is

z=x2+y2.\begin{align*} |z| &= \sqrt{x^2+y^2}. \end{align*}

Return Type

  • Name
    result
    Type
    Real
    Description

    A real number.

Snippet

PROPERTY
Magnitude
Complex z = new(3, 4);
z.Magnitude;

Result

5

PROPERTYPhase

Phase

Get the phase of a complex number.

Let z=x+iyz=x+iy, where xx and yy are real numbers and ii is the complex unit. The, the magnitude of zz, written as argz\arg z, is

argz=atan2(yx),\begin{align*} \arg z &= \atan{y}{x}, \end{align*}

where π<argzπ-\pi<\arg z\leq\pi.

Return Type

  • Name
    result
    Type
    Real
    Description

    A real number.

Snippet

PROPERTY
Phase
Complex z = new(3, 4);
z.Phase;

Result

0.9272952180016122

FUNCTIONConjugate

Conjugate

Compute the conjugate, z\overline{z}, of a complex number.

Let z=x+iyz=x+iy, where xx and yy are real numbers and ii is the complex unit. Then, the complex conjugate of zz, written as z\overline{z}, is

z=x+iy=xiy.\begin{align*} \overline{z} &= \overline{x+iy} \\ &= x-iy. \end{align*}

Required Parameters

  • Name
    z
    Type
    Complex
    Description

    A complex number.

Return Type

  • Name
    result
    Type
    Complex
    Description

    A complex number.

Snippet

FUNCTION
Conjugate
Complex z = new(1, 2);
Complex.Conjugate(z);

Result

(1,-2)

Footnotes

  1. See Complex Variables and Applications by James Ward Brown and Ruel V. Churchill for an introduction to Complex Analysis.