Edit

Share via


Complex Struct

Definition

Represents a complex number.

public value class Complex : IEquatable<System::Numerics::Complex>, IFormattable
public value class Complex : IEquatable<System::Numerics::Complex>, IParsable<System::Numerics::Complex>, ISpanParsable<System::Numerics::Complex>, System::Numerics::IAdditionOperators<System::Numerics::Complex, System::Numerics::Complex, System::Numerics::Complex>, System::Numerics::IAdditiveIdentity<System::Numerics::Complex, System::Numerics::Complex>, System::Numerics::IDecrementOperators<System::Numerics::Complex>, System::Numerics::IDivisionOperators<System::Numerics::Complex, System::Numerics::Complex, System::Numerics::Complex>, System::Numerics::IEqualityOperators<System::Numerics::Complex, System::Numerics::Complex, bool>, System::Numerics::IIncrementOperators<System::Numerics::Complex>, System::Numerics::IMultiplicativeIdentity<System::Numerics::Complex, System::Numerics::Complex>, System::Numerics::IMultiplyOperators<System::Numerics::Complex, System::Numerics::Complex, System::Numerics::Complex>, System::Numerics::INumberBase<System::Numerics::Complex>, System::Numerics::ISignedNumber<System::Numerics::Complex>, System::Numerics::ISubtractionOperators<System::Numerics::Complex, System::Numerics::Complex, System::Numerics::Complex>, System::Numerics::IUnaryNegationOperators<System::Numerics::Complex, System::Numerics::Complex>, System::Numerics::IUnaryPlusOperators<System::Numerics::Complex, System::Numerics::Complex>
public value class Complex : IEquatable<System::Numerics::Complex>, IParsable<System::Numerics::Complex>, ISpanParsable<System::Numerics::Complex>, IUtf8SpanParsable<System::Numerics::Complex>, System::Numerics::IAdditionOperators<System::Numerics::Complex, System::Numerics::Complex, System::Numerics::Complex>, System::Numerics::IAdditiveIdentity<System::Numerics::Complex, System::Numerics::Complex>, System::Numerics::IDecrementOperators<System::Numerics::Complex>, System::Numerics::IDivisionOperators<System::Numerics::Complex, System::Numerics::Complex, System::Numerics::Complex>, System::Numerics::IEqualityOperators<System::Numerics::Complex, System::Numerics::Complex, bool>, System::Numerics::IIncrementOperators<System::Numerics::Complex>, System::Numerics::IMultiplicativeIdentity<System::Numerics::Complex, System::Numerics::Complex>, System::Numerics::IMultiplyOperators<System::Numerics::Complex, System::Numerics::Complex, System::Numerics::Complex>, System::Numerics::INumberBase<System::Numerics::Complex>, System::Numerics::ISignedNumber<System::Numerics::Complex>, System::Numerics::ISubtractionOperators<System::Numerics::Complex, System::Numerics::Complex, System::Numerics::Complex>, System::Numerics::IUnaryNegationOperators<System::Numerics::Complex, System::Numerics::Complex>, System::Numerics::IUnaryPlusOperators<System::Numerics::Complex, System::Numerics::Complex>
public struct Complex : IEquatable<System.Numerics.Complex>, IFormattable
public readonly struct Complex : IEquatable<System.Numerics.Complex>, IFormattable
public readonly struct Complex : IEquatable<System.Numerics.Complex>, IParsable<System.Numerics.Complex>, ISpanParsable<System.Numerics.Complex>, System.Numerics.IAdditionOperators<System.Numerics.Complex,System.Numerics.Complex,System.Numerics.Complex>, System.Numerics.IAdditiveIdentity<System.Numerics.Complex,System.Numerics.Complex>, System.Numerics.IDecrementOperators<System.Numerics.Complex>, System.Numerics.IDivisionOperators<System.Numerics.Complex,System.Numerics.Complex,System.Numerics.Complex>, System.Numerics.IEqualityOperators<System.Numerics.Complex,System.Numerics.Complex,bool>, System.Numerics.IIncrementOperators<System.Numerics.Complex>, System.Numerics.IMultiplicativeIdentity<System.Numerics.Complex,System.Numerics.Complex>, System.Numerics.IMultiplyOperators<System.Numerics.Complex,System.Numerics.Complex,System.Numerics.Complex>, System.Numerics.INumberBase<System.Numerics.Complex>, System.Numerics.ISignedNumber<System.Numerics.Complex>, System.Numerics.ISubtractionOperators<System.Numerics.Complex,System.Numerics.Complex,System.Numerics.Complex>, System.Numerics.IUnaryNegationOperators<System.Numerics.Complex,System.Numerics.Complex>, System.Numerics.IUnaryPlusOperators<System.Numerics.Complex,System.Numerics.Complex>
public readonly struct Complex : IEquatable<System.Numerics.Complex>, IParsable<System.Numerics.Complex>, ISpanParsable<System.Numerics.Complex>, IUtf8SpanParsable<System.Numerics.Complex>, System.Numerics.IAdditionOperators<System.Numerics.Complex,System.Numerics.Complex,System.Numerics.Complex>, System.Numerics.IAdditiveIdentity<System.Numerics.Complex,System.Numerics.Complex>, System.Numerics.IDecrementOperators<System.Numerics.Complex>, System.Numerics.IDivisionOperators<System.Numerics.Complex,System.Numerics.Complex,System.Numerics.Complex>, System.Numerics.IEqualityOperators<System.Numerics.Complex,System.Numerics.Complex,bool>, System.Numerics.IIncrementOperators<System.Numerics.Complex>, System.Numerics.IMultiplicativeIdentity<System.Numerics.Complex,System.Numerics.Complex>, System.Numerics.IMultiplyOperators<System.Numerics.Complex,System.Numerics.Complex,System.Numerics.Complex>, System.Numerics.INumberBase<System.Numerics.Complex>, System.Numerics.ISignedNumber<System.Numerics.Complex>, System.Numerics.ISubtractionOperators<System.Numerics.Complex,System.Numerics.Complex,System.Numerics.Complex>, System.Numerics.IUnaryNegationOperators<System.Numerics.Complex,System.Numerics.Complex>, System.Numerics.IUnaryPlusOperators<System.Numerics.Complex,System.Numerics.Complex>
[System.Serializable]
public struct Complex : IEquatable<System.Numerics.Complex>, IFormattable
type Complex = struct
    interface IFormattable
type Complex = struct
    interface IFormattable
    interface IParsable<Complex>
    interface ISpanFormattable
    interface ISpanParsable<Complex>
    interface IAdditionOperators<Complex, Complex, Complex>
    interface IAdditiveIdentity<Complex, Complex>
    interface IDecrementOperators<Complex>
    interface IDivisionOperators<Complex, Complex, Complex>
    interface IEqualityOperators<Complex, Complex, bool>
    interface IIncrementOperators<Complex>
    interface IMultiplicativeIdentity<Complex, Complex>
    interface IMultiplyOperators<Complex, Complex, Complex>
    interface INumberBase<Complex>
    interface ISubtractionOperators<Complex, Complex, Complex>
    interface IUnaryNegationOperators<Complex, Complex>
    interface IUnaryPlusOperators<Complex, Complex>
    interface ISignedNumber<Complex>
type Complex = struct
    interface IFormattable
    interface IParsable<Complex>
    interface ISpanFormattable
    interface ISpanParsable<Complex>
    interface IAdditionOperators<Complex, Complex, Complex>
    interface IAdditiveIdentity<Complex, Complex>
    interface IDecrementOperators<Complex>
    interface IDivisionOperators<Complex, Complex, Complex>
    interface IEqualityOperators<Complex, Complex, bool>
    interface IIncrementOperators<Complex>
    interface IMultiplicativeIdentity<Complex, Complex>
    interface IMultiplyOperators<Complex, Complex, Complex>
    interface INumberBase<Complex>
    interface ISubtractionOperators<Complex, Complex, Complex>
    interface IUnaryNegationOperators<Complex, Complex>
    interface IUnaryPlusOperators<Complex, Complex>
    interface IUtf8SpanFormattable
    interface IUtf8SpanParsable<Complex>
    interface ISignedNumber<Complex>
type Complex = struct
    interface IFormattable
    interface IParsable<Complex>
    interface ISpanFormattable
    interface ISpanParsable<Complex>
    interface IAdditionOperators<Complex, Complex, Complex>
    interface IAdditiveIdentity<Complex, Complex>
    interface IDecrementOperators<Complex>
    interface IDivisionOperators<Complex, Complex, Complex>
    interface IEqualityOperators<Complex, Complex, bool>
    interface IIncrementOperators<Complex>
    interface IMultiplicativeIdentity<Complex, Complex>
    interface IMultiplyOperators<Complex, Complex, Complex>
    interface INumberBase<Complex>
    interface IUtf8SpanFormattable
    interface IUtf8SpanParsable<Complex>
    interface ISubtractionOperators<Complex, Complex, Complex>
    interface IUnaryNegationOperators<Complex, Complex>
    interface IUnaryPlusOperators<Complex, Complex>
    interface ISignedNumber<Complex>
[<System.Serializable>]
type Complex = struct
    interface IFormattable
Public Structure Complex
Implements IEquatable(Of Complex), IFormattable
Public Structure Complex
Implements IAdditionOperators(Of Complex, Complex, Complex), IAdditiveIdentity(Of Complex, Complex), IDecrementOperators(Of Complex), IDivisionOperators(Of Complex, Complex, Complex), IEqualityOperators(Of Complex, Complex, Boolean), IEquatable(Of Complex), IIncrementOperators(Of Complex), IMultiplicativeIdentity(Of Complex, Complex), IMultiplyOperators(Of Complex, Complex, Complex), INumberBase(Of Complex), IParsable(Of Complex), ISignedNumber(Of Complex), ISpanParsable(Of Complex), ISubtractionOperators(Of Complex, Complex, Complex), IUnaryNegationOperators(Of Complex, Complex), IUnaryPlusOperators(Of Complex, Complex)
Public Structure Complex
Implements IAdditionOperators(Of Complex, Complex, Complex), IAdditiveIdentity(Of Complex, Complex), IDecrementOperators(Of Complex), IDivisionOperators(Of Complex, Complex, Complex), IEqualityOperators(Of Complex, Complex, Boolean), IEquatable(Of Complex), IIncrementOperators(Of Complex), IMultiplicativeIdentity(Of Complex, Complex), IMultiplyOperators(Of Complex, Complex, Complex), INumberBase(Of Complex), IParsable(Of Complex), ISignedNumber(Of Complex), ISpanParsable(Of Complex), ISubtractionOperators(Of Complex, Complex, Complex), IUnaryNegationOperators(Of Complex, Complex), IUnaryPlusOperators(Of Complex, Complex), IUtf8SpanParsable(Of Complex)
Inheritance
Complex
Attributes
Implements

Remarks

For more information about this API, see Supplemental API remarks for Complex.

Constructors

Complex(Double, Double)

Initializes a new instance of the Complex structure using the specified real and imaginary values.

Fields

ImaginaryOne

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

Infinity

Represents infinity as a complex number.

NaN

Represents a complex instance that is not a number (NaN).

One

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

Zero

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

Properties

Imaginary

Gets the imaginary component of the current Complex object.

Magnitude

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

Phase

Gets the phase of a complex number.

Real

Gets the real component of the current Complex object.

Methods

Abs(Complex)

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

Acos(Complex)

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

Add(Complex, Complex)

Adds two complex numbers and returns the result.

Add(Complex, Double)

Adds a complex number to a double-precision real number and returns the result.

Add(Double, Complex)

Adds a double-precision real number to a complex number and returns the result.

Asin(Complex)

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

Atan(Complex)

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

Conjugate(Complex)

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

Cos(Complex)

Returns the cosine of the specified complex number.

Cosh(Complex)

Returns the hyperbolic cosine of the specified complex number.

CreateChecked<TOther>(TOther)

Creates an instance of the current type from a value, throwing an overflow exception for any values that fall outside the representable range of the current type.

CreateSaturating<TOther>(TOther)

Creates an instance of the current type from a value, saturating any values that fall outside the representable range of the current type.

CreateTruncating<TOther>(TOther)

Creates an instance of the current type from a value, truncating any values that fall outside the representable range of the current type.

Divide(Complex, Complex)

Divides one complex number by another and returns the result.

Divide(Complex, Double)

Divides one complex number by a double-precision real number and returns the result.

Divide(Double, Complex)

Divides one double-precision real number by a complex number and returns the result.

Equals(Complex)

Returns a value that indicates whether the current instance and a specified complex number have the same value.

Equals(Object)

Returns a value that indicates whether the current instance and a specified object have the same value.

Exp(Complex)

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

FromPolarCoordinates(Double, Double)

Creates a complex number from a point's polar coordinates.

GetHashCode()

Returns the hash code for the current Complex object.

IsComplexNumber(Complex)

Determines if a value represents a complex value.

IsEvenInteger(Complex)

Determines if a value represents an even integral number.

IsFinite(Complex)

Determines whether the specified complex number is finite.

IsImaginaryNumber(Complex)

Determines if a value represents an imaginary number.

IsInfinity(Complex)

Returns a value indicating whether the specified complex number evaluates to infinity.

IsInteger(Complex)

Determines if a value represents an integral value.

IsNaN(Complex)

Returns a value that indicates whether the specified complex instance is not a number (NaN).

IsNegative(Complex)

Determines if a value is negative.

IsNegativeInfinity(Complex)

Determines if a value is negative infinity.

IsNormal(Complex)

Determines if a value is normal.

IsOddInteger(Complex)

Determines if a value represents an odd integral number.

IsPositive(Complex)

Determines if a value is positive.

IsPositiveInfinity(Complex)

Determines if a value is positive infinity.

IsRealNumber(Complex)

Determines if a value represents a real number.

IsSubnormal(Complex)

Determines if a value is subnormal.

Log(Complex, Double)

Returns the logarithm of a specified complex number in a specified base.

Log(Complex)

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

Log10(Complex)

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

MaxMagnitude(Complex, Complex)

Compares two values to compute which is greater.

MinMagnitude(Complex, Complex)

Compares two values to compute which is lesser.

Multiply(Complex, Complex)

Returns the product of two complex numbers.

Multiply(Complex, Double)

Returns the product of a complex number and a double-precision real number.

Multiply(Double, Complex)

Returns the product of a double-precision real number and a complex number.

Negate(Complex)

Returns the additive inverse of a specified complex number.

Parse(ReadOnlySpan<Char>, IFormatProvider)

Parses a span of characters into a value.

Parse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider)

Parses a span of characters into a value.

Parse(String, IFormatProvider)

Parses a string into a value.

Parse(String, NumberStyles, IFormatProvider)

Parses a string into a value.

Pow(Complex, Complex)

Returns a specified complex number raised to a power specified by a complex number.

Pow(Complex, Double)

Returns a specified complex number raised to a power specified by a double-precision floating-point number.

Reciprocal(Complex)

Returns the multiplicative inverse of a complex number.

Sin(Complex)

Returns the sine of the specified complex number.

Sinh(Complex)

Returns the hyperbolic sine of the specified complex number.

Sqrt(Complex)

Returns the square root of a specified complex number.

Subtract(Complex, Complex)

Subtracts one complex number from another and returns the result.

Subtract(Complex, Double)

Subtracts one double-precision real number from a complex number and returns the result.

Subtract(Double, Complex)

Subtracts one complex number from a double-precision real number and returns the result.

Tan(Complex)

Returns the tangent of the specified complex number.

Tanh(Complex)

Returns the hyperbolic tangent of the specified complex number.

ToString()

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

ToString(IFormatProvider)

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

ToString(String, IFormatProvider)

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.

ToString(String)

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.

TryFormat(Span<Byte>, Int32, ReadOnlySpan<Char>, IFormatProvider)
TryFormat(Span<Char>, Int32, ReadOnlySpan<Char>, IFormatProvider)

Tries to format the value of the current instance into the provided span of characters.

TryParse(ReadOnlySpan<Char>, IFormatProvider, Complex)

Tries to parse a span of characters into a value.

TryParse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider, Complex)

Tries to parse a span of characters into a value.

TryParse(String, IFormatProvider, Complex)

Tries to parse a string into a value.

TryParse(String, NumberStyles, IFormatProvider, Complex)

Tries to parse a string into a value.

Operators

Addition(Complex, Complex)

Adds two complex numbers.

Addition(Complex, Double)

Adds a complex number to a double-precision real number.

Addition(Double, Complex)

Adds a double-precision real number to a complex number.

Decrement(Complex)

Decrements a value.

Division(Complex, Complex)

Divides a specified complex number by another specified complex number.

Division(Complex, Double)

Divides a specified complex number by a specified double-precision real number.

Division(Double, Complex)

Divides a specified double-precision real number by a specified complex number.

Equality(Complex, Complex)

Returns a value that indicates whether two complex numbers are equal.

Explicit(BigInteger to Complex)

Defines an explicit conversion of a BigInteger value to a complex number.

Explicit(Decimal to Complex)

Defines an explicit conversion of a Decimal value to a complex number.

Explicit(Int128 to Complex)

Explicitly converts a Int128 value to a double-precision complex number.

Explicit(UInt128 to Complex)

Explicitly converts a UInt128 value to a double-precision complex number.

Implicit(Byte to Complex)

Defines an implicit conversion of an unsigned byte to a complex number.

Implicit(Char to Complex)

Implicitly converts a Char value to a double-precision complex number.

Implicit(Double to Complex)

Defines an implicit conversion of a double-precision floating-point number to a complex number.

Implicit(Half to Complex)

Implicitly converts a Half value to a double-precision complex number.

Implicit(Int16 to Complex)

Defines an implicit conversion of a 16-bit signed integer to a complex number.

Implicit(Int32 to Complex)

Defines an implicit conversion of a 32-bit signed integer to a complex number.

Implicit(Int64 to Complex)

Defines an implicit conversion of a 64-bit signed integer to a complex number.

Implicit(IntPtr to Complex)

Implicitly converts a IntPtr value to a double-precision complex number.

Implicit(SByte to Complex)

Defines an implicit conversion of a signed byte to a complex number.

This API is not CLS-compliant.

Implicit(Single to Complex)

Defines an implicit conversion of a single-precision floating-point number to a complex number.

Implicit(UInt16 to Complex)

Defines an implicit conversion of a 16-bit unsigned integer to a complex number.

This API is not CLS-compliant.

Implicit(UInt32 to Complex)

Defines an implicit conversion of a 32-bit unsigned integer to a complex number.

This API is not CLS-compliant.

Implicit(UInt64 to Complex)

Defines an implicit conversion of a 64-bit unsigned integer to a complex number.

This API is not CLS-compliant.

Implicit(UIntPtr to Complex)

Implicitly converts a UIntPtr value to a double-precision complex number.

Increment(Complex)

Increments a value.

Inequality(Complex, Complex)

Returns a value that indicates whether two complex numbers are not equal.

Multiply(Complex, Complex)

Multiplies two specified complex numbers.

Multiply(Complex, Double)

Multiplies the specified complex number by a specified double-precision real number.

Multiply(Double, Complex)

Multiplies a specified double-precision real number by a specified complex number.

Subtraction(Complex, Complex)

Subtracts a complex number from another complex number.

Subtraction(Complex, Double)

Subtracts a double-precision real number from a complex number.

Subtraction(Double, Complex)

Subtracts a complex number from a double-precision real number.

UnaryNegation(Complex)

Returns the additive inverse of a specified complex number.

UnaryPlus(Complex)

Computes the unary plus of a value.

Explicit Interface Implementations

IAdditiveIdentity<Complex,Complex>.AdditiveIdentity

Gets the additive identity of the current type.

IMultiplicativeIdentity<Complex,Complex>.MultiplicativeIdentity

Gets the multiplicative identity of the current type.

INumberBase<Complex>.Abs(Complex)

Computes the absolute of a value.

INumberBase<Complex>.IsCanonical(Complex)

Determines if a value is in its canonical representation.

INumberBase<Complex>.IsZero(Complex)

Determines if a value is zero.

INumberBase<Complex>.MaxMagnitudeNumber(Complex, Complex)

Compares two values to compute which has the greater magnitude and returning the other value if an input is NaN.

INumberBase<Complex>.MinMagnitudeNumber(Complex, Complex)

Compares two values to compute which has the lesser magnitude and returning the other value if an input is NaN.

INumberBase<Complex>.MultiplyAddEstimate(Complex, Complex, Complex)

Computes an estimate of (left * right) + addend.

INumberBase<Complex>.One

Gets the value 1 for the type.

INumberBase<Complex>.Radix

Gets the radix, or base, for the type.

INumberBase<Complex>.TryConvertFromChecked<TOther>(TOther, Complex)
INumberBase<Complex>.TryConvertFromSaturating<TOther>(TOther, Complex)
INumberBase<Complex>.TryConvertFromTruncating<TOther>(TOther, Complex)
INumberBase<Complex>.TryConvertToChecked<TOther>(Complex, TOther)

Tries to convert an instance of the the current type to another type, throwing an overflow exception for any values that fall outside the representable range of the current type.

INumberBase<Complex>.TryConvertToSaturating<TOther>(Complex, TOther)

Tries to convert an instance of the the current type to another type, saturating any values that fall outside the representable range of the current type.

INumberBase<Complex>.TryConvertToTruncating<TOther>(Complex, TOther)

Tries to convert an instance of the the current type to another type, truncating any values that fall outside the representable range of the current type.

INumberBase<Complex>.Zero

Gets the value 0 for the type.

ISignedNumber<Complex>.NegativeOne

Gets the value -1 for the type.

Applies to