Namespaces

Types in MathNet.Numerics

Type ComplexExtensions

Namespace MathNet.Numerics

Extension methods for the Complex type provided by System.Numerics

Static Functions

Public Static Functions

Complex Conjugate(this Complex complex)

Gets the conjugate of the Complex number.
The semantic of is such that // a, b of type Complex32 a.Conjugate = b; is equivalent to // a, b of type Complex32 a = b.Conjugate
Parameters
Complex complex

The Complex number to perfom this operation on.

Return
Complex

The conjugate of the Complex number.

Tuple<Complex, Complex, Complex> CubicRoots(this Complex complex)

Evaluate all cubic roots of this Complex.

Complex Exp(this Complex complex)

Exponential of this Complex (exp(x), E^x).
Parameters
Complex complex

The Complex number to perfom this operation on.

Return
Complex

The exponential of this complex number.

bool IsImaginaryOne(this Complex complex)

Gets a value indicating whether the Complex32 is the imaginary unit.
Parameters
Complex complex

The Complex number to perfom this operation on.

Return
bool

true if this instance is ImaginaryOne; otherwise, false.

bool IsInfinity(this Complex complex)

Gets a value indicating whether the provided Complex32 evaluates to an infinite value.
True if it either evaluates to a complex infinity or to a directed infinity.
Parameters
Complex complex

The Complex number to perfom this operation on.

Return
bool

true if this instance is infinite; otherwise, false.

bool IsNaN(this Complex complex)

Gets a value indicating whether the provided Complex32 evaluates to a value that is not a number.
Parameters
Complex complex

The Complex number to perfom this operation on.

Return
bool

true if this instance is NaN ; otherwise, false.

bool IsOne(this Complex complex)

Gets a value indicating whether the Complex32 is one.
Parameters
Complex complex

The Complex number to perfom this operation on.

Return
bool

true if this instance is one; otherwise, false.

bool IsReal(this Complex complex)

Gets a value indicating whether the provided Complex32 is real.
Parameters
Complex complex

The Complex number to perfom this operation on.

Return
bool

true if this instance is a real number; otherwise, false.

bool IsRealNonNegative(this Complex complex)

Gets a value indicating whether the provided Complex32 is real and not negative, that is >= 0.
Parameters
Complex complex

The Complex number to perfom this operation on.

Return
bool

true if this instance is real nonnegative number; otherwise, false.

bool IsZero(this Complex complex)

Gets a value indicating whether the Complex32 is zero.
Parameters
Complex complex

The Complex number to perfom this operation on.

Return
bool

true if this instance is zero; otherwise, false.

Complex Ln(this Complex complex)

Natural Logarithm of this Complex (Base E).
Parameters
Complex complex

The Complex number to perfom this operation on.

Return
Complex

The natural logarithm of this complex number.

Complex Log(this Complex complex, double baseValue)

Logarithm of this Complex with custom base.
Return
Complex

The logarithm of this complex number.

Complex Log10(this Complex complex)

Common Logarithm of this Complex (Base 10).
Return
Complex

The common logarithm of this complex number.

double MagnitudeSquared(this Complex complex)

Gets the squared magnitude of the Complex number.
Parameters
Complex complex

The Complex number to perfom this operation on.

Return
double

The squared magnitude of the Complex number.

double Norm(this Complex complex)

Returns a Norm of a value of this type, which is appropriate for measuring how close this value is to zero.

double Norm(this Complex32 complex)

Returns a Norm of a value of this type, which is appropriate for measuring how close this value is to zero.

double NormOfDifference(this Complex complex, Complex otherValue)

Returns a Norm of the difference of two values of this type, which is appropriate for measuring how close together these two values are.

double NormOfDifference(this Complex32 complex, Complex32 otherValue)

Returns a Norm of the difference of two values of this type, which is appropriate for measuring how close together these two values are.

Complex Power(this Complex complex, Complex exponent)

Raise this Complex to the given value.
Parameters
Complex complex

The Complex number to perfom this operation on.

Complex exponent

The exponent.

Return
Complex

The complex number raised to the given exponent.

Complex Reciprocal(this Complex complex)

Returns the multiplicative inverse of a complex number.

Complex Root(this Complex complex, Complex rootExponent)

Raise this Complex to the inverse of the given value.
Parameters
Complex complex

The Complex number to perfom this operation on.

Complex rootExponent

The root exponent.

Return
Complex

The complex raised to the inverse of the given exponent.

Complex Sign(this Complex complex)

Gets the unity of this complex (same argument, but on the unit circle; exp(I*arg))
Return
Complex

The unity of this Complex.

Complex Square(this Complex complex)

The Square (power 2) of this Complex
Parameters
Complex complex

The Complex number to perfom this operation on.

Return
Complex

The square of this complex number.

Complex SquareRoot(this Complex complex)

The Square Root (power 1/2) of this Complex
Parameters
Complex complex

The Complex number to perfom this operation on.

Return
Complex

The square root of this complex number.

Tuple<Complex, Complex> SquareRoots(this Complex complex)

Evaluate all square roots of this Complex.

Complex ToComplex(this string value)

Creates a complex number based on a string. The string can be in the following formats (without the quotes): 'n', 'ni', 'n +/- ni', 'ni +/- n', 'n,n', 'n,ni,' '(n,n)', or '(n,ni)', where n is a double.
Parameters
string value

The string to parse.

Return
Complex

A complex number containing the value specified by the given string.

Complex ToComplex(this string value, IFormatProvider formatProvider)

Creates a complex number based on a string. The string can be in the following formats (without the quotes): 'n', 'ni', 'n +/- ni', 'ni +/- n', 'n,n', 'n,ni,' '(n,n)', or '(n,ni)', where n is a double.
Parameters
string value

the string to parse.

IFormatProvider formatProvider

An IFormatProvider that supplies culture-specific formatting information.

Return
Complex

A complex number containing the value specified by the given string.

Complex32 ToComplex32(this string value)

Creates a Complex32 number based on a string. The string can be in the following formats (without the quotes): 'n', 'ni', 'n +/- ni', 'ni +/- n', 'n,n', 'n,ni,' '(n,n)', or '(n,ni)', where n is a double.
Parameters
string value

the string to parse.

Return
Complex32

A complex number containing the value specified by the given string.

Complex32 ToComplex32(this string value, IFormatProvider formatProvider)

Creates a Complex32 number based on a string. The string can be in the following formats (without the quotes): 'n', 'ni', 'n +/- ni', 'ni +/- n', 'n,n', 'n,ni,' '(n,n)', or '(n,ni)', where n is a double.
Parameters
string value

the string to parse.

IFormatProvider formatProvider

An IFormatProvider that supplies culture-specific formatting information.

Return
Complex32

A complex number containing the value specified by the given string.

bool TryToComplex(this string value, IFormatProvider formatProvider, Complex& result)

bool TryToComplex(this string value, Complex& result)

bool TryToComplex32(this string value, Complex32& result)

bool TryToComplex32(this string value, IFormatProvider formatProvider, Complex32& result)