Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

struct System.​Numerics.​Complex

Assembly: System.Runtime.Numerics

Represents a complex number.

Fields and Constants

public static readonly Complex
ImaginaryOne
Returns a new <see cref="T:System.Numerics.Complex" /> instance with a real number equal to zero and an imaginary number equal to one.
public static readonly Complex
Infinity
Represents infinity as a complex number.
public static readonly Complex
NaN
Represents a complex instance that is not a number (NaN).
public static readonly Complex
One
Returns a new <see cref="T:System.Numerics.Complex" /> instance with a real number equal to one and an imaginary number equal to zero.
public static readonly Complex
Zero
Returns a new <see cref="T:System.Numerics.Complex" /> instance with a real number equal to zero and an imaginary number equal to zero.

Properties

public double
Imaginary
Gets the imaginary component of the current <see cref="T:System.Numerics.Complex" /> object.
public double
Magnitude
Gets the magnitude (or absolute value) of a complex number.
public double
Phase
Gets the phase of a complex number.
public double
Real
Gets the real component of the current <see cref="T:System.Numerics.Complex" /> object.

Methods

public bool
Equals​(Complex value)
value The complex number to compare.
Returns <see langword="true" /> if this complex number and <paramref name="value" /> have the same value; otherwise, <see langword="false" /> .
Returns a value that indicates whether the current instance and a specified complex number have the same value.
public bool
Equals​(object obj)
obj The object to compare.
Returns <see langword="true" /> if the <paramref name="obj" /> parameter is a <see cref="T:System.Numerics.Complex" /> object or a type capable of implicit conversion to a <see cref="T:System.Numerics.Complex" /> object, and its value is equal to the current <see cref="T:System.Numerics.Complex" /> object; otherwise, <see langword="false" /> .
Returns a value that indicates whether the current instance and a specified object have the same value.
public int
GetHashCode​()
Returns A 32-bit signed integer hash code.
Returns the hash code for the current <see cref="T:System.Numerics.Complex" /> object.
public string
ToString​()
Returns The string representation of the current instance in Cartesian form.
Converts the value of the current complex number to its equivalent string representation in Cartesian form.
public string
ToString​(IFormatProvider provider)
provider An object that supplies culture-specific formatting information.
Returns The string representation of the current instance in Cartesian form, as specified by <paramref name="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.
public string
ToString​(string format)
format A standard or custom numeric format string.
Returns The string representation of the current instance in Cartesian form.
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.
public string
ToString​(string format, IFormatProvider provider)
format A standard or custom numeric format string.
provider An object that supplies culture-specific formatting information.
Returns The string representation of the current instance in Cartesian form, as specified by <paramref name="format" /> and <paramref name="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.
public bool
TryFormat​(Span`1 destination, Int32& charsWritten, ReadOnlySpan`1 format = null, IFormatProvider provider = null)
public bool
TryFormat​(Span`1 utf8Destination, Int32& bytesWritten, ReadOnlySpan`1 format = null, IFormatProvider provider = null)
protected void
Finalize​()
Inherited from object
public Type
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object