Click or drag to resize

Complex32 Structure

32-bit single precision complex numbers class.
Inheritance Hierarchy
SystemObject
  SystemValueType
    Altaxo.CalcComplex32

Namespace: Altaxo.Calc
Assembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3179.0 (4.8.3179.0)
Syntax
C#
[SerializableAttribute]
public readonly struct Complex32 : IFormattable, 
	IEquatable<Complex32>

The Complex32 type exposes the following members.

Constructors
 NameDescription
Public methodComplex32 Initializes a new instance of the Complex32 structure with the given real and imaginary parts.
Top
Properties
 NameDescription
Public propertyImaginary Gets the real imaginary component of the complex number.
Public propertyMagnitude Gets the magnitude (or absolute value) of a complex number.
Public propertyMagnitudeSquared Gets the squared magnitude (or squared absolute value) of a complex number.
Public propertyPhase Gets the phase or argument of this Complex32.
Public propertyReal Gets the real component of the complex number.
Public propertySign Gets the unity of this complex (same argument, but on the unit circle; exp(I*arg))
Top
Methods
 NameDescription
Public methodStatic memberAbs Gets the absolute value (or magnitude) of a complex number.
Public methodStatic memberAcos Returns the angle that is the arc cosine of the specified complex number.
Public methodStatic memberAdd Adds two complex numbers and returns the result.
Public methodStatic memberAsin Returns the angle that is the arc sine of the specified complex number.
Public methodStatic memberAtan Returns the angle that is the arc tangent of the specified complex number.
Public methodCommonLogarithm Common Logarithm of this Complex32 (Base 10).
Public methodConjugate Computes the conjugate of a complex number and returns the result.
Public methodStatic memberConjugate(Complex32) Computes the conjugate of a complex number and returns the result.
Public methodStatic memberCos Returns the cosine of the specified complex number.
Public methodStatic memberCosh Returns the hyperbolic cosine of the specified complex number.
Public methodCubicRoots Evaluate all cubic roots of this Complex32.
Public methodStatic memberDivide Divides one complex number by another and returns the result.
Public methodEquals(Complex32) Checks if two complex numbers are equal. Two complex numbers are equal if their corresponding real and imaginary components are equal.
Public methodEquals(Object) Checks if two complex numbers are equal. Two complex numbers are equal if their corresponding real and imaginary components are equal.
(Overrides ValueTypeEquals(Object))
Public methodStatic memberExp Returns e raised to the power specified by a complex number.
Public methodExponential Exponential of this Complex32 (exp(x), E^x).
Public methodStatic memberFromPolarCoordinates Creates a complex number from a point's polar coordinates.
Public methodGetHashCode The hash code for the complex number.
(Overrides ValueTypeGetHashCode)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodIsImaginaryOne Gets a value indicating whether the Complex32 is the imaginary unit.
Public methodIsInfinity Gets a value indicating whether the provided Complex32 evaluates to an infinite value.
Public methodIsNaN Gets a value indicating whether the provided Complex32evaluates to a value that is not a number.
Public methodIsOne Gets a value indicating whether the Complex32 is one.
Public methodIsReal Gets a value indicating whether the provided Complex32 is real.
Public methodIsRealNonNegative Gets a value indicating whether the provided Complex32 is real and not negative, that is >= 0.
Public methodIsZero Gets a value indicating whether the Complex32 is zero.
Public methodStatic memberLog(Complex32) Returns the natural (base e) logarithm of a specified complex number.
Public methodStatic memberLog(Complex32, Single) Returns the logarithm of a specified complex number in a specified base.
Public methodStatic memberLog10 Returns the base-10 logarithm of a specified complex number.
Public methodLogarithm Logarithm of this Complex32 with custom base.
Public methodStatic memberMultiply Returns the product of two complex numbers.
Public methodNaturalLogarithm Natural Logarithm of this Complex32 (Base E).
Public methodStatic memberNegate Returns the additive inverse of a specified complex number.
Public methodStatic memberParse 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.
Public methodStatic memberPow(Complex32, Complex32) Returns a specified complex number raised to a power specified by a complex number.
Public methodStatic memberPow(Complex32, Single) Returns a specified complex number raised to a power specified by a single-precision floating-point number.
Public methodPower Raise this Complex32 to the given value.
Public methodReciprocal Returns the multiplicative inverse of a complex number.
Public methodStatic memberReciprocal(Complex32) Returns the multiplicative inverse of a complex number.
Public methodRoot Raise this Complex32 to the inverse of the given value.
Public methodStatic memberSin Returns the sine of the specified complex number.
Public methodStatic memberSinh Returns the hyperbolic sine of the specified complex number.
Public methodStatic memberSqrt Returns the square root of a specified complex number.
Public methodSquare The Square (power 2) of this Complex32
Public methodSquareRoot The Square Root (power 1/2) of this Complex32
Public methodSquareRoots Evaluate all square roots of this Complex32.
Public methodStatic memberSubtract Subtracts one complex number from another and returns the result.
Public methodStatic memberTan Returns the tangent of the specified complex number.
Public methodStatic memberTanh Returns the hyperbolic tangent of the specified complex number.
Public methodToComplex Converts this Complex32 to a Complex.
Public methodToString Converts the value of the current complex number to its equivalent string representation in Cartesian form.
(Overrides ValueTypeToString)
Public methodToString(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.
Public methodToString(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.
Public methodToString(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.
Public methodStatic memberTryParse(String, Complex32) Converts the string representation of a complex number to a single-precision complex number equivalent. A return value indicates whether the conversion succeeded or failed.
Public methodStatic memberTryParse(String, IFormatProvider, Complex32) Converts the string representation of a complex number to single-precision complex number equivalent. A return value indicates whether the conversion succeeded or failed.
Top
Operators
 NameDescription
Public operatorStatic memberAddition(Complex32, Complex32)Addition operator. Adds two complex numbers together.
Public operatorStatic memberAddition(Complex32, Single)Addition operator. Adds a complex number and float together.
Public operatorStatic memberAddition(Single, Complex32)Addition operator. Adds a complex number and float together.
Public operatorStatic memberDivision(Complex32, Complex32)Division operator. Divides a complex number by another.
Public operatorStatic memberDivision(Complex32, Single)Division operator. Divides a complex number by a float value.
Public operatorStatic memberDivision(Single, Complex32)Division operator. Divides a float value by a complex number.
Public operatorStatic memberEquality(Complex32, Complex32) Equality test.
Public operatorStatic member(Complex to Complex32) Explicit conversion of a Complex to a Complex32.
Public operatorStatic member(Decimal to Complex32) Explicit conversion of a real decimal to a Complex32.
Public operatorStatic member(Double to Complex32) Implicit conversion of a real double to a Complex32.
Public operatorStatic member(BigInteger to Complex32) Implicit conversion of a BigInteger int to a Complex32.
Public operatorStatic member(Byte to Complex32) Implicit conversion of a real byte to a Complex32.
Public operatorStatic member(Int16 to Complex32) Implicit conversion of a real short to a Complex32.
Public operatorStatic member(Int32 to Complex32) Implicit conversion of a real int to a Complex32.
Public operatorStatic member(Int64 to Complex32) Implicit conversion of a real long to a Complex32.
Public operatorStatic member(SByte to Complex32) Implicit conversion of a signed byte to a Complex32.
Public operatorStatic member(Single to Complex32) Implicit conversion of a real float to a Complex32.
Public operatorStatic member(UInt16 to Complex32) Implicit conversion of a unsigned real short to a Complex32.
Public operatorStatic member(UInt32 to Complex32) Implicit conversion of a real uint to a Complex32.
Public operatorStatic member(UInt64 to Complex32) Implicit conversion of a real ulong to a Complex32.
Public operatorStatic memberInequality(Complex32, Complex32) Inequality test.
Public operatorStatic memberMultiply(Complex32, Complex32)Multiplication operator. Multiplies two complex numbers.
Public operatorStatic memberMultiply(Complex32, Single)Multiplication operator. Multiplies a complex number with a float value.
Public operatorStatic memberMultiply(Single, Complex32)Multiplication operator. Multiplies a complex number with a float value.
Public operatorStatic memberSubtraction(Complex32, Complex32)Subtraction operator. Subtracts two complex numbers.
Public operatorStatic memberSubtraction(Complex32, Single)Subtraction operator. Subtracts float value from a complex value.
Public operatorStatic memberSubtraction(Single, Complex32)Subtraction operator. Subtracts complex value from a float value.
Public operatorStatic memberUnaryNegation(Complex32) Unary minus.
Public operatorStatic memberUnaryPlus(Complex32) Unary addition.
Top
Fields
 NameDescription
Public fieldStatic memberImaginaryOne Returns a new Complex32 instance with a real number equal to zero and an imaginary number equal to one.
Public fieldStatic memberNaN Returns a new Complex32 instance with real and imaginary numbers not a number.
Public fieldStatic memberOne Returns a new Complex32 instance with a real number equal to one and an imaginary number equal to zero.
Public fieldStatic memberPositiveInfinity Returns a new Complex32 instance with real and imaginary numbers positive infinite.
Public fieldStatic memberZero Returns a new Complex32 instance with a real number equal to zero and an imaginary number equal to zero.
Top
Extension Methods
 NameDescription
Public Extension MethodAlmostEqual Checks whether two Complex numbers are almost equal.
(Defined by Precision)
Public Extension MethodAlmostEqual Compares two complex and determines if they are equal within the specified maximum error.
(Defined by Precision)
Public Extension MethodAlmostEqual Compares two doubles and determines if they are equal to within the specified number of decimal places or not, using the number of decimal places as an absolute measure.
(Defined by Precision)
Public Extension MethodAlmostEqualRelative Checks whether two Complex numbers are almost equal.
(Defined by Precision)
Public Extension MethodAlmostEqualRelative Compares two complex and determines if they are equal within the specified maximum error.
(Defined by Precision)
Public Extension MethodAlmostEqualRelative Compares two doubles and determines if they are equal to within the specified number of decimal places or not. If the numbers are very close to zero an absolute difference is compared, otherwise the relative difference is compared.
(Defined by Precision)
Public Extension MethodMagnitudeSquared Gets the squared magnitude of the Complex number.
(Defined by ComplexExtensions)
Public Extension MethodNorm Returns a Norm of a value of this type, which is appropriate for measuring how close this value is to zero.
(Defined by ComplexExtensions)
Public Extension MethodNormOfDifference Returns a Norm of the difference of two values of this type, which is appropriate for measuring how close together these two values are.
(Defined by ComplexExtensions)
Top
Remarks

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.

C#
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 Wikipedia

See Also