Namespaces

Types in MathNet.Numerics

Type Complex32

Namespace MathNet.Numerics

Parent ValueType

Interfaces IFormattable, IEquatable<Complex32>

32-bit single precision complex numbers class.

The class Complex32 provides all elementary operations on complex numbers. All the operators + , - , * , / , == , != are defined in the canonical way. Additional complex trigonometric functions are also provided. Note that the Complex32 structures has two special constant values NaN and PositiveInfinity.

Complex32 x = new Complex32(1f,2f); Complex32 y = Complex32.FromPolarCoordinates(1f, Math.Pi); Complex32 z = (x + y) / (x - y);

For mathematical details about complex numbers, please have a look at the

Constructors

Static Functions

Methods

Properties

Fields

Public Constructors

Complex32(float real, float imaginary)

Initializes a new instance of the Complex32 structure with the given real and imaginary parts.
Parameters
float real

The value for the real component.

float imaginary

The value for the imaginary component.

Public Static Functions

double Abs(Complex32 value)

Gets the absolute value (or magnitude) of a complex number.
Parameters
Complex32 value

A complex number.

Return
double

The absolute value of value.

Complex32 Acos(Complex32 value)

Returns the angle that is the arc cosine of the specified complex number.
Parameters
Complex32 value

A complex number that represents a cosine.

Return
Complex32

The angle, measured in radians, which is the arc cosine of value.

Complex32 Add(Complex32 left, Complex32 right)

Adds two complex numbers and returns the result.
Parameters
Complex32 left

The first complex number to add.

Complex32 right

The second complex number to add.

Return
Complex32

The sum of left and right.

Complex32 Asin(Complex32 value)

Returns the angle that is the arc sine of the specified complex number.
Parameters
Complex32 value

A complex number.

Return
Complex32

The angle which is the arc sine of value.

Complex32 Atan(Complex32 value)

Returns the angle that is the arc tangent of the specified complex number.
Parameters
Complex32 value

A complex number.

Return
Complex32

The angle that is the arc tangent of value.

Complex32 Conjugate(Complex32 value)

Computes the conjugate of a complex number and returns the result.
Parameters
Complex32 value

A complex number.

Return
Complex32

The conjugate of value.

Complex32 Cos(Complex32 value)

Returns the cosine of the specified complex number.
Parameters
Complex32 value

A complex number.

Return
Complex32

The cosine of value.

Complex32 Cosh(Complex32 value)

Returns the hyperbolic cosine of the specified complex number.
Parameters
Complex32 value

A complex number.

Return
Complex32

The hyperbolic cosine of value.

Complex32 Divide(Complex32 dividend, Complex32 divisor)

Divides one complex number by another and returns the result.
Parameters
Complex32 dividend

The complex number to be divided.

Complex32 divisor

The complex number to divide by.

Return
Complex32

The quotient of the division.

Complex32 Exp(Complex32 value)

Returns e raised to the power specified by a complex number.
Parameters
Complex32 value

A complex number that specifies a power.

Return
Complex32

The number e raised to the power value.

Complex32 FromPolarCoordinates(float magnitude, float phase)

Creates a complex number from a point's polar coordinates.
Parameters
float magnitude

The magnitude, which is the distance from the origin (the intersection of the x-axis and the y-axis) to the number.

float phase

The phase, which is the angle from the line to the horizontal axis, measured in radians.

Return
Complex32

A complex number.

Complex32 Log(Complex32 value, float baseValue)

Returns the logarithm of a specified complex number in a specified base.
Parameters
Complex32 value

A complex number.

float baseValue

The base of the logarithm.

Return
Complex32

The logarithm of value in base baseValue.

Complex32 Log(Complex32 value)

Returns the natural (base e) logarithm of a specified complex number.
Parameters
Complex32 value

A complex number.

Return
Complex32

The natural (base e) logarithm of value.

Complex32 Log10(Complex32 value)

Returns the base-10 logarithm of a specified complex number.
Parameters
Complex32 value

A complex number.

Return
Complex32

The base-10 logarithm of value.

Complex32 Multiply(Complex32 left, Complex32 right)

Returns the product of two complex numbers.
Parameters
Complex32 left

The first complex number to multiply.

Complex32 right

The second complex number to multiply.

Return
Complex32

The product of the left and right parameters.

Complex32 Negate(Complex32 value)

Returns the additive inverse of a specified complex number.
Parameters
Complex32 value

A complex number.

Return
Complex32

The result of the real and imaginary components of the value parameter multiplied by -1.

Complex32 Parse(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 float.
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.

Complex32 Pow(Complex32 value, Complex32 power)

Returns a specified complex number raised to a power specified by a complex number.
Parameters
Complex32 value

A complex number to be raised to a power.

Complex32 power

A complex number that specifies a power.

Return
Complex32

The complex number value raised to the power power.

Complex32 Pow(Complex32 value, float power)

Returns a specified complex number raised to a power specified by a single-precision floating-point number.
Parameters
Complex32 value

A complex number to be raised to a power.

float power

A single-precision floating-point number that specifies a power.

Return
Complex32

The complex number value raised to the power power.

Complex32 Reciprocal(Complex32 value)

Returns the multiplicative inverse of a complex number.
Parameters
Complex32 value

A complex number.

Return
Complex32

The reciprocal of value.

Complex32 Sin(Complex32 value)

Returns the sine of the specified complex number.
Parameters
Complex32 value

A complex number.

Return
Complex32

The sine of value.

Complex32 Sinh(Complex32 value)

Returns the hyperbolic sine of the specified complex number.
Parameters
Complex32 value

A complex number.

Return
Complex32

The hyperbolic sine of value.

Complex32 Sqrt(Complex32 value)

Returns the square root of a specified complex number.
Parameters
Complex32 value

A complex number.

Return
Complex32

The square root of value.

Complex32 Subtract(Complex32 left, Complex32 right)

Subtracts one complex number from another and returns the result.
Parameters
Complex32 left

The value to subtract from (the minuend).

Complex32 right

The value to subtract (the subtrahend).

Return
Complex32

The result of subtracting right from left.

Complex32 Tan(Complex32 value)

Returns the tangent of the specified complex number.
Parameters
Complex32 value

A complex number.

Return
Complex32

The tangent of value.

Complex32 Tanh(Complex32 value)

Returns the hyperbolic tangent of the specified complex number.
Parameters
Complex32 value

A complex number.

Return
Complex32

The hyperbolic tangent of value.

bool TryParse(string value, IFormatProvider formatProvider, Complex32& result)

bool TryParse(string value, Complex32& result)

Public Methods

Complex32 CommonLogarithm()

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

The common logarithm of this complex number.

Complex32 Conjugate()

Computes the conjugate of a complex number and returns the result.

ValueTuple<Complex32, Complex32, Complex32> CubicRoots()

Evaluate all cubic roots of this Complex32.

bool Equals(object obj)

Checks if two complex numbers are equal. Two complex numbers are equal if their corresponding real and imaginary components are equal.
Parameters
object obj

The complex number to compare to with.

Return
bool

Returns true if the two objects are the same object, or if their corresponding real and imaginary components are equal, false otherwise.

bool Equals(Complex32 other)

Checks if two complex numbers are equal. Two complex numbers are equal if their corresponding real and imaginary components are equal.
Parameters
Complex32 other

The complex number to compare to with.

Return
bool

Returns true if the two objects are the same object, or if their corresponding real and imaginary components are equal, false otherwise.

Complex32 Exponential()

Exponential of this Complex32 (exp(x), E^x).
Return
Complex32

The exponential of this complex number.

int GetHashCode()

The hash code for the complex number.
The hash code is calculated as System.Math.Exp(ComplexMath.Absolute(complexNumber)).
Return
int

The hash code of the complex number.

Type GetType()

bool IsImaginaryOne()

Gets a value indicating whether the Complex32 is the imaginary unit.
Return
bool

true if this instance is ImaginaryOne; otherwise, false.

bool IsInfinity()

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.
Return
bool

true if this instance is infinite; otherwise, false.

bool IsNaN()

Gets a value indicating whether the provided Complex32 evaluates to a value that is not a number.
Return
bool

true if this instance is NaN ; otherwise, false.

bool IsOne()

Gets a value indicating whether the Complex32 is one.
Return
bool

true if this instance is one; otherwise, false.

bool IsReal()

Gets a value indicating whether the provided Complex32 is real.
Return
bool

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

bool IsRealNonNegative()

Gets a value indicating whether the provided Complex32 is real and not negative, that is >= 0.
Return
bool

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

bool IsZero()

Gets a value indicating whether the Complex32 is zero.
Return
bool

true if this instance is zero; otherwise, false.

Complex32 Logarithm(float baseValue)

Logarithm of this Complex32 with custom base.
Return
Complex32

The logarithm of this complex number.

Complex32 NaturalLogarithm()

Natural Logarithm of this Complex32 (Base E).
Return
Complex32

The natural logarithm of this complex number.

Complex32 Power(Complex32 exponent)

Raise this Complex32 to the given value.
Parameters
Complex32 exponent

The exponent.

Return
Complex32

The complex number raised to the given exponent.

Complex32 Reciprocal()

Returns the multiplicative inverse of a complex number.

Complex32 Root(Complex32 rootExponent)

Raise this Complex32 to the inverse of the given value.
Parameters
Complex32 rootExponent

The root exponent.

Return
Complex32

The complex raised to the inverse of the given exponent.

Complex32 Square()

The Square (power 2) of this Complex32
Return
Complex32

The square of this complex number.

Complex32 SquareRoot()

The Square Root (power 1/2) of this Complex32
Return
Complex32

The square root of this complex number.

ValueTuple<Complex32, Complex32> SquareRoots()

Evaluate all square roots of this Complex32.

Complex ToComplex()

Converts this Complex32 to a Complex.
Return
Complex

A Complex with the same values as this Complex32.

string ToString(string format, IFormatProvider provider)

Converts the value of the current complex number to its equivalent string representation in Cartesian form by using the specified format and culture-specific format information for its real and imaginary parts.
Parameters
string format

A standard or custom numeric format string.

IFormatProvider provider

An object that supplies culture-specific formatting information.

Return
string

The string representation of the current instance in Cartesian form, as specified by format and provider.

string ToString(IFormatProvider provider)

Converts the value of the current complex number to its equivalent string representation in Cartesian form by using the specified culture-specific formatting information.
Parameters
IFormatProvider provider

An object that supplies culture-specific formatting information.

Return
string

The string representation of the current instance in Cartesian form, as specified by provider.

string ToString(string format)

Converts the value of the current complex number to its equivalent string representation in Cartesian form by using the specified format for its real and imaginary parts.
Parameters
string format

A standard or custom numeric format string.

Return
string

The string representation of the current instance in Cartesian form.

string ToString()

Converts the value of the current complex number to its equivalent string representation in Cartesian form.
Return
string

The string representation of the current instance in Cartesian form.

Public Properties

float Imaginary get;

Gets the real imaginary component of the complex number.
Value:

float Magnitude get;

Gets the magnitude (or absolute value) of a complex number.
Assuming that magnitude of (inf,a) and (a,inf) and (inf,inf) is inf and (NaN,a), (a,NaN) and (NaN,NaN) is NaN

float MagnitudeSquared get;

Gets the squared magnitude (or squared absolute value) of a complex number.

float Phase get;

Gets the phase or argument of this Complex32.
Phase always returns a value bigger than negative Pi and smaller or equal to Pi. If this Complex32 is zero, the Complex32 is assumed to be positive real with an argument of zero.

float Real get;

Gets the real component of the complex number.
Value:

Complex32 Sign get;

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

Public fields

Complex32 Zero

Returns a new Complex32 instance with a real number equal to zero and an imaginary number equal to zero.
return Complex32

Complex32 One

Returns a new Complex32 instance with a real number equal to one and an imaginary number equal to zero.
return Complex32

Complex32 ImaginaryOne

Returns a new Complex32 instance with a real number equal to zero and an imaginary number equal to one.
return Complex32

Complex32 PositiveInfinity

Returns a new Complex32 instance with real and imaginary numbers positive infinite.
return Complex32

Complex32 NaN

Returns a new Complex32 instance with real and imaginary numbers not a number.
return Complex32