Struct ComplexNumber
public struct ComplexNumber : IEquatable<ComplexNumber>, IFormattable
- Implements
- Inherited Members
Constructors
ComplexNumber(BigDecimal)
public ComplexNumber(BigDecimal real)
Parameters
realBigDecimal
ComplexNumber(BigDecimal, BigDecimal)
public ComplexNumber(BigDecimal real, BigDecimal imaginary)
Parameters
realBigDecimalimaginaryBigDecimal
ComplexNumber(BigDecimal, BigDecimal, MathHelperOptions)
public ComplexNumber(BigDecimal real, BigDecimal imaginary, MathHelperOptions options)
Parameters
realBigDecimalimaginaryBigDecimaloptionsMathHelperOptions
ComplexNumber(BigDecimal, MathHelperOptions)
public ComplexNumber(BigDecimal real, MathHelperOptions options)
Parameters
realBigDecimaloptionsMathHelperOptions
ComplexNumber(object, object, MathHelperOptions)
public ComplexNumber(object real, object imaginary, MathHelperOptions options)
Parameters
realobjectimaginaryobjectoptionsMathHelperOptions
Fields
ImaginaryOne
public static readonly ComplexNumber ImaginaryOne
Field Value
One
public static readonly ComplexNumber One
Field Value
Zero
public static readonly ComplexNumber Zero
Field Value
Properties
Abs
public BigDecimal Abs { get; }
Property Value
- BigDecimal
Imaginary
public readonly BigDecimal Imaginary { get; }
Property Value
- BigDecimal
IsImaginary
public bool IsImaginary { get; }
Property Value
IsReal
public bool IsReal { get; }
Property Value
IsZero
public bool IsZero { get; }
Property Value
Magnitude
public BigDecimal Magnitude { get; }
Property Value
- BigDecimal
MagnitudeSquared
public BigDecimal MagnitudeSquared { get; }
Property Value
- BigDecimal
Phase
public BigDecimal Phase { get; }
Property Value
- BigDecimal
Real
public readonly BigDecimal Real { get; }
Property Value
- BigDecimal
Tolerance
public static double Tolerance { get; set; }
Property Value
Methods
Acos(ComplexNumber, MathHelperOptions)
public static ComplexNumber Acos(ComplexNumber value, MathHelperOptions options)
Parameters
valueComplexNumberoptionsMathHelperOptions
Returns
Acosh(ComplexNumber, MathHelperOptions)
public static ComplexNumber Acosh(ComplexNumber value, MathHelperOptions options)
Parameters
valueComplexNumberoptionsMathHelperOptions
Returns
Acot(ComplexNumber, MathHelperOptions)
public static ComplexNumber Acot(ComplexNumber value, MathHelperOptions options)
Parameters
valueComplexNumberoptionsMathHelperOptions
Returns
Acoth(ComplexNumber, MathHelperOptions)
public static ComplexNumber Acoth(ComplexNumber value, MathHelperOptions options)
Parameters
valueComplexNumberoptionsMathHelperOptions
Returns
Acsc(ComplexNumber, MathHelperOptions)
public static ComplexNumber Acsc(ComplexNumber value, MathHelperOptions options)
Parameters
valueComplexNumberoptionsMathHelperOptions
Returns
Acsch(ComplexNumber, MathHelperOptions)
public static ComplexNumber Acsch(ComplexNumber value, MathHelperOptions options)
Parameters
valueComplexNumberoptionsMathHelperOptions
Returns
Asec(ComplexNumber, MathHelperOptions)
public static ComplexNumber Asec(ComplexNumber value, MathHelperOptions options)
Parameters
valueComplexNumberoptionsMathHelperOptions
Returns
Asech(ComplexNumber, MathHelperOptions)
public static ComplexNumber Asech(ComplexNumber value, MathHelperOptions options)
Parameters
valueComplexNumberoptionsMathHelperOptions
Returns
Asin(ComplexNumber, MathHelperOptions)
public static ComplexNumber Asin(ComplexNumber value, MathHelperOptions options)
Parameters
valueComplexNumberoptionsMathHelperOptions
Returns
Asinh(ComplexNumber, MathHelperOptions)
public static ComplexNumber Asinh(ComplexNumber value, MathHelperOptions options)
Parameters
valueComplexNumberoptionsMathHelperOptions
Returns
Atan(ComplexNumber, MathHelperOptions)
public static ComplexNumber Atan(ComplexNumber value, MathHelperOptions options)
Parameters
valueComplexNumberoptionsMathHelperOptions
Returns
Atanh(ComplexNumber, MathHelperOptions)
public static ComplexNumber Atanh(ComplexNumber value, MathHelperOptions options)
Parameters
valueComplexNumberoptionsMathHelperOptions
Returns
Ceiling(ComplexNumber)
public static ComplexNumber Ceiling(ComplexNumber value)
Parameters
valueComplexNumber
Returns
CheckIsReal()
public bool CheckIsReal()
Returns
Conjugate()
public ComplexNumber Conjugate()
Returns
Cos(ComplexNumber, MathHelperOptions)
public static ComplexNumber Cos(ComplexNumber value, MathHelperOptions options)
Parameters
valueComplexNumberoptionsMathHelperOptions
Returns
Cosh(ComplexNumber, MathHelperOptions)
public static ComplexNumber Cosh(ComplexNumber value, MathHelperOptions options)
Parameters
valueComplexNumberoptionsMathHelperOptions
Returns
Cot(ComplexNumber, MathHelperOptions)
public static ComplexNumber Cot(ComplexNumber value, MathHelperOptions options)
Parameters
valueComplexNumberoptionsMathHelperOptions
Returns
Coth(ComplexNumber, MathHelperOptions)
public static ComplexNumber Coth(ComplexNumber value, MathHelperOptions options)
Parameters
valueComplexNumberoptionsMathHelperOptions
Returns
Csc(ComplexNumber, MathHelperOptions)
public static ComplexNumber Csc(ComplexNumber value, MathHelperOptions options)
Parameters
valueComplexNumberoptionsMathHelperOptions
Returns
Csch(ComplexNumber, MathHelperOptions)
public static ComplexNumber Csch(ComplexNumber value, MathHelperOptions options)
Parameters
valueComplexNumberoptionsMathHelperOptions
Returns
Equals(ComplexNumber)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(ComplexNumber other)
Parameters
otherComplexNumberAn object to compare with this object.
Returns
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand this instance are the same type and represent the same value; otherwise, false.
Exp(ComplexNumber, MathHelperOptions)
public static ComplexNumber Exp(ComplexNumber value, MathHelperOptions options)
Parameters
valueComplexNumberoptionsMathHelperOptions
Returns
Floor(ComplexNumber)
public static ComplexNumber Floor(ComplexNumber value)
Parameters
valueComplexNumber
Returns
FromComplex(Complex, MathHelperOptions)
Creates a ComplexNumber from a Complex.
Both components are widened from double to ExtendedNumerics.BigDecimal.
public static ComplexNumber FromComplex(Complex c, MathHelperOptions options = default)
Parameters
cComplexoptionsMathHelperOptions
Returns
FromPolar(BigDecimal, BigDecimal, MathHelperOptions)
public static ComplexNumber FromPolar(BigDecimal magnitude, BigDecimal phase, MathHelperOptions options)
Parameters
magnitudeBigDecimalphaseBigDecimaloptionsMathHelperOptions
Returns
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
Log(ComplexNumber, BigDecimal, MathHelperOptions)
public static ComplexNumber Log(ComplexNumber value, BigDecimal baseValue, MathHelperOptions options)
Parameters
valueComplexNumberbaseValueBigDecimaloptionsMathHelperOptions
Returns
Log(ComplexNumber, MathHelperOptions)
public static ComplexNumber Log(ComplexNumber value, MathHelperOptions options)
Parameters
valueComplexNumberoptionsMathHelperOptions
Returns
Log10(ComplexNumber, MathHelperOptions)
Returns the base-10 logarithm of a complex number.
public static ComplexNumber Log10(ComplexNumber value, MathHelperOptions options)
Parameters
valueComplexNumberoptionsMathHelperOptions
Returns
MaxByMagnitude(ComplexNumber, ComplexNumber)
public static ComplexNumber MaxByMagnitude(ComplexNumber x, ComplexNumber y)
Parameters
Returns
MinByMagnitude(ComplexNumber, ComplexNumber)
public static ComplexNumber MinByMagnitude(ComplexNumber x, ComplexNumber y)
Parameters
Returns
Normalize()
public ComplexNumber Normalize()
Returns
Pow(ComplexNumber, BigDecimal, MathHelperOptions)
public static ComplexNumber Pow(ComplexNumber value, BigDecimal power, MathHelperOptions options)
Parameters
valueComplexNumberpowerBigDecimaloptionsMathHelperOptions
Returns
Pow(ComplexNumber, ComplexNumber, MathHelperOptions)
public static ComplexNumber Pow(ComplexNumber value, ComplexNumber power, MathHelperOptions options)
Parameters
valueComplexNumberpowerComplexNumberoptionsMathHelperOptions
Returns
Reciprocal()
public ComplexNumber Reciprocal()
Returns
Round(ComplexNumber)
public static ComplexNumber Round(ComplexNumber value)
Parameters
valueComplexNumber
Returns
Sec(ComplexNumber, MathHelperOptions)
public static ComplexNumber Sec(ComplexNumber value, MathHelperOptions options)
Parameters
valueComplexNumberoptionsMathHelperOptions
Returns
Sech(ComplexNumber, MathHelperOptions)
public static ComplexNumber Sech(ComplexNumber value, MathHelperOptions options)
Parameters
valueComplexNumberoptionsMathHelperOptions
Returns
Sin(ComplexNumber, MathHelperOptions)
public static ComplexNumber Sin(ComplexNumber value, MathHelperOptions options)
Parameters
valueComplexNumberoptionsMathHelperOptions
Returns
Sinh(ComplexNumber, MathHelperOptions)
public static ComplexNumber Sinh(ComplexNumber value, MathHelperOptions options)
Parameters
valueComplexNumberoptionsMathHelperOptions
Returns
Sqrt(ComplexNumber, MathHelperOptions)
public static ComplexNumber Sqrt(ComplexNumber value, MathHelperOptions options)
Parameters
valueComplexNumberoptionsMathHelperOptions
Returns
Tan(ComplexNumber, MathHelperOptions)
public static ComplexNumber Tan(ComplexNumber value, MathHelperOptions options)
Parameters
valueComplexNumberoptionsMathHelperOptions
Returns
Tanh(ComplexNumber, MathHelperOptions)
public static ComplexNumber Tanh(ComplexNumber value, MathHelperOptions options)
Parameters
valueComplexNumberoptionsMathHelperOptions
Returns
ToComplex()
Converts this complex number to a Complex.
Both the real and imaginary components are narrowed from
ExtendedNumerics.BigDecimal to double.
public Complex ToComplex()
Returns
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.
ToString(string?, IFormatProvider?)
Formats the value of the current instance using the specified format.
public string ToString(string? format, IFormatProvider? formatProvider)
Parameters
formatstringThe format to use.
-or-
A null reference (
Nothingin Visual Basic) to use the default format defined for the type of the IFormattable implementation.formatProviderIFormatProviderThe provider to use to format the value.
-or-
A null reference (
Nothingin Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.
Returns
- string
The value of the current instance in the specified format.
Truncate(ComplexNumber)
public static ComplexNumber Truncate(ComplexNumber value)
Parameters
valueComplexNumber
Returns
Operators
operator +(BigDecimal, ComplexNumber)
public static ComplexNumber operator +(BigDecimal r, ComplexNumber z)
Parameters
rBigDecimalzComplexNumber
Returns
operator +(ComplexNumber, BigDecimal)
public static ComplexNumber operator +(ComplexNumber z, BigDecimal r)
Parameters
zComplexNumberrBigDecimal
Returns
operator +(ComplexNumber, ComplexNumber)
public static ComplexNumber operator +(ComplexNumber a, ComplexNumber b)
Parameters
Returns
operator +(ComplexNumber, double)
public static ComplexNumber operator +(ComplexNumber z, double r)
Parameters
zComplexNumberrdouble
Returns
operator +(double, ComplexNumber)
public static ComplexNumber operator +(double r, ComplexNumber z)
Parameters
rdoublezComplexNumber
Returns
operator /(BigDecimal, ComplexNumber)
public static ComplexNumber operator /(BigDecimal scalar, ComplexNumber value)
Parameters
scalarBigDecimalvalueComplexNumber
Returns
operator /(ComplexNumber, BigDecimal)
public static ComplexNumber operator /(ComplexNumber value, BigDecimal divisor)
Parameters
valueComplexNumberdivisorBigDecimal
Returns
operator /(ComplexNumber, ComplexNumber)
public static ComplexNumber operator /(ComplexNumber a, ComplexNumber b)
Parameters
Returns
operator /(ComplexNumber, double)
public static ComplexNumber operator /(ComplexNumber value, double divisor)
Parameters
valueComplexNumberdivisordouble
Returns
operator /(double, ComplexNumber)
public static ComplexNumber operator /(double scalar, ComplexNumber value)
Parameters
scalardoublevalueComplexNumber
Returns
operator ==(ComplexNumber, ComplexNumber)
public static bool operator ==(ComplexNumber a, ComplexNumber b)
Parameters
Returns
explicit operator Complex(ComplexNumber)
Explicitly converts a ComplexNumber to a Complex.
public static explicit operator Complex(ComplexNumber c)
Parameters
Returns
explicit operator ComplexNumber(Complex)
Explicitly converts a Complex to a ComplexNumber.
public static explicit operator ComplexNumber(Complex c)
Parameters
cComplex
Returns
implicit operator ComplexNumber(double)
public static implicit operator ComplexNumber(double value)
Parameters
valuedouble
Returns
operator !=(ComplexNumber, ComplexNumber)
public static bool operator !=(ComplexNumber a, ComplexNumber b)
Parameters
Returns
operator *(BigDecimal, ComplexNumber)
public static ComplexNumber operator *(BigDecimal r, ComplexNumber z)
Parameters
rBigDecimalzComplexNumber
Returns
operator *(ComplexNumber, BigDecimal)
public static ComplexNumber operator *(ComplexNumber z, BigDecimal r)
Parameters
zComplexNumberrBigDecimal
Returns
operator *(ComplexNumber, ComplexNumber)
public static ComplexNumber operator *(ComplexNumber a, ComplexNumber b)
Parameters
Returns
operator *(ComplexNumber, double)
public static ComplexNumber operator *(ComplexNumber z, double r)
Parameters
zComplexNumberrdouble
Returns
operator *(double, ComplexNumber)
public static ComplexNumber operator *(double r, ComplexNumber z)
Parameters
rdoublezComplexNumber
Returns
operator -(BigDecimal, ComplexNumber)
public static ComplexNumber operator -(BigDecimal r, ComplexNumber z)
Parameters
rBigDecimalzComplexNumber
Returns
operator -(ComplexNumber, BigDecimal)
public static ComplexNumber operator -(ComplexNumber z, BigDecimal r)
Parameters
zComplexNumberrBigDecimal
Returns
operator -(ComplexNumber, ComplexNumber)
public static ComplexNumber operator -(ComplexNumber a, ComplexNumber b)
Parameters
Returns
operator -(ComplexNumber, double)
public static ComplexNumber operator -(ComplexNumber z, double r)
Parameters
zComplexNumberrdouble
Returns
operator -(double, ComplexNumber)
public static ComplexNumber operator -(double r, ComplexNumber z)
Parameters
rdoublezComplexNumber
Returns
operator -(ComplexNumber)
public static ComplexNumber operator -(ComplexNumber a)