Imaginary<T> Structure
Definition
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.3
[SerializableAttribute]
public readonly struct Imaginary<T> : IEquatable<Imaginary<T>>,
IEquatable<Complex<T>>, IEquatable<T>, IComparable<Imaginary<T>>
- Implements
- IComparable<Imaginary<T>>, IEquatable<Imaginary<T>>, IEquatable<Complex<T>>, IEquatable<T>
Type Parameters
- T
Remarks
The imaginary value type represents a complex value made of a zero real part and an imaginary part of type T.
Imaginary numbers are a special kind of complex numbers arise in algebra in the solution of quadratic equations. The equation x2= –R.One does not have any real solutions. However, if we define a new number, i as the square root of -R.One, then we have two solutions: i and -i.
This, in turn, gives rise to an entirely new class of numbers of the form a + ib with a and b real, and i defined as above. These are the complex numbers.
The imaginary structure provides methods for all the common operations on imaginary numbers. The Im returns the imaginary part of the imaginary number. Because the complex numbers don't have a natural ordering, only equality and inequality operators are available.
Overloaded versions of the major arithmetic operators are provided for languages that support them. For languages that don't support operator overloading, equivalent static methods are supplied.
Binary operations are defined between imaginary numbers and real, imaginary, and complex numbers. The type of the result depends on the combination of operands. For example, multiplying two imaginary numbers results in a real number.
If T is a floating-point type, then operations including the assignment operators, do not throw exceptions. Instead, in exceptional situations, the result of a floating-point operation is zero, Infinity, or NaN, as described below:
- If the result of a complex floating-point operation is too small for the destination format, the result of the operation is zero.
- If the magnitude of the complex result of a floating-point operation is too large for the destination format, the result of the operation is Infinity. Directed infinities are currently not supported.
- If a complex floating-point operation is invalid, the result of the operation is NaN.
- If one or both operands of a complex floating-point operation are NaN, the result of the operation is NaN.
Many elementary functions have been extended to the complex domain. These are implemented by static methods.
Some of these functions are multi-valued. If there is one real argument, then any symmetry or anti-symmetry about the origin is preserved. For example, the inverse sine function satisfies asin(-x) == -asin(x) for -1 <= x <= 1. The Asin(Imaginary<T>) method satisfies this relationship for any real value of x.
For complex arguments, the identity Conjugate(f(x)) == f(Conjugate(x)) is preserved. The branch cuts for all complex functions defined here are along either the real or the imaginary axis. Along the branch cuts, the functions have different values depending on whether the zero element is normal (positive) zero or negative zero.
The real and imaginary parts of complex numbers are real numbers.
Constructors
Imaginary<T> | Constructs an imaginary number from its imaginary part. |
Properties
Im | Gets the imaginary part of the complex number. |
IsImaginary | Indicates whether an imaginary number is a pure imaginary number. |
IsReal | Indicates whether an imaginary number is, in fact, real. |
IsZero | Indicates whether an imaginary number is equal to zero. |
Magnitude | Gets the magnitude, modulus or absolute value of an imaginary number. |
Magnitude | Returns the square of the modulus of a complex number. |
One | Returns the sum of the absolute values of the real and the imaginary part of the imaginary number. |
Phase | Gets the phase or argument of an imaginary number. |
Methods
Abs | Returns the absolute value of an imaginary number. |
Acos | Gets the inverse cosine of an imaginary number. |
Acosh | Gets the inverse hyperbolic cosine of an imaginary number. |
Add( | Adds an imaginary number to a real number. |
Add( | Adds an imaginary number to a real number. |
Add( | Adds two imaginary numbers. |
Arg | Returns the argument of an imaginary number. |
Asin | Gets the inverse sine of an imaginary number. |
Asinh | Gets the inverse hyperbolic sine of an imaginary number. |
Atan | Gets the inverse tangent of an imaginary number. |
Atanh | Gets the inverse hyperbolic tangent of an imaginary number. |
Cbrt | Returns the first square root of an imaginary number. |
Conjugate() | Returns the conjugate of this imaginary number. |
Conjugate( | Returns the conjugate of an imaginary number. |
Conjugate | Multiplies the Conjugate() of an imaginary number and a second imaginary number. |
Cos | Gets the cosine of an imaginary number. |
Cosh | Gets the hyperbolic cosine of an imaginary number. |
Deconstruct | Deconstructs an imaginary number into its real and complex parts. |
Divide( | Divides a real number by an imaginary number. |
Divide( | Divides an imaginary number by a real number. |
Divide( | Divides an imaginary number by another. |
Equals( | Compares an imaginary number to a complex number. |
Equals( | Compares an imaginary number to a real number. |
Equals( | Compares an imaginary number to another complex number. |
Equals( |
Overridden. Returns whether this
instance is equal to a specified object.
(Overrides ValueType.Equals(Object)) |
Exp | Returns e raised to the specified power. |
Exp10 | Returns 10 raised to the specified power. |
Exp2 | Returns 2 raised to the specified power. |
Exp | Computes E raised to a given power and subtracts one. |
Get |
Overridden. Returns the hash code for this instance.
(Overrides ValueType.GetHashCode()) |
Get | Returns an array of Doubles that contains the imaginary parts of an array of complex numbers. |
Get | Returns an array of Doubles that contains the real parts of an array of complex numbers. |
Get | Gets the Type of the current instance. (Inherited from Object) |
IsInfinity | Indicates whether an imaginary number is infinite. |
IsNa | Indicates whether an imaginary number is undefined. |
Log( | Returns the natural logarithm of an imaginary number. |
Log( | Returns the logarithm of an imaginary number to the specified base. |
Log10 | Returns the base 10 logarithm of an imaginary number. |
Log2 | Returns the base 2 logarithm of an imaginary number. |
Multiply( | Multiplies an imaginary number and a real number. |
Multiply( | Multiplies an imaginary number and a real number. |
Multiply( | Multiplies two imaginary numbers. |
Negate | Negates an imaginary number. |
Plus | Applies the unary plus operator to an imaginary number. |
Pow( | Returns an imaginary number raised to the specified power. |
Pow( | Returns an imaginary number raised to the specified power. |
Pow( | Returns an imaginary number raised to the specified integer power. |
Reciprocal | Returns the reciprocal of an imaginary number. |
Sin | Gets the sine of an imaginary number. |
Sin | Gets the sine and cosine of an imaginary number. |
Sinh | Gets the hyperbolic sine of an imaginary number. |
Sqrt | Returns the first square root of an imaginary number. |
Subtract( | Subtracts an imaginary number from a real number. |
Subtract( | Subtracts a real number from an imaginary number. |
Subtract( | Subtracts two imaginary numbers. |
Tan | Gets the tangent of an imaginary number. |
Tanh | Gets the hyperbolic tangent of an imaginary number. |
ToString() |
Converts the numeric value of this instance to its
equivalent string representation.
(Overrides ValueType.ToString()) |
ToString( | Converts the numeric value of this instance to its equivalent string representation using the specified culture-specific format information. |
ToString( | Converts the numeric value of this instance to its equivalent string representation using the specified format. |
ToString( | Converts the numeric value of this instance to its equivalent string representation using the specified format and culture-specific format information. |
Operators
Addition( | Adds an imaginary number to a complex number. |
Addition( | Adds an imaginary number to a real number. |
Addition( | Adds an imaginary number to a real number. |
Addition( | Adds an imaginary number to a complex number. |
Addition( | Adds two complex numbers. |
Division( | Divides a complex number by an imaginary number. |
Division( | Divides a real number by an imaginary number. |
Division( | Divides an imaginary number by a real number. |
Division( | Divides an imaginary number by a complex number. |
Division( | Divides an imaginary number by another. |
Equality( | Compares an imaginary number and a real number for equality. |
Equality( | Compares an imaginary number and a real number for equality. |
Equality( | Compares two complex numbers for equality. |
Explicit(Complex<T> to Imaginary<T>) | Casts a complex number to an imaginary number. The real part is set to zero. |
Explicit(Imaginary<T> to T) | Casts an imaginary number to a real number. The imaginary part must be zero. |
Exponent( | Represents the exponentiation operator. |
Exponent( | Represents the exponentiation operator. |
Exponent( | Represents the exponentiation operator. |
Exponentiation( | Represents the exponentiation operator. |
Exponentiation( | Represents the exponentiation operator. |
Exponentiation( | Represents the exponentiation operator. |
Implicit(T to Imaginary<T>) | Implicitly casts a real number to a complex type. |
Implicit(Imaginary<T> to Complex<T>) | Implicitly converts an imaginary number to a complex number. |
Inequality( | Compares an imaginary number and a real number for inequality. |
Inequality( | Compares an imaginary number and a real number for inequality. |
Inequality( | Compares two complex numbers for inequality. |
Multiply( | Multiplies an imaginary number and a complex number. |
Multiply( | Multiplies an imaginary number and a real number. |
Multiply( | Multiplies an imaginary number and a real number. |
Multiply( | Multiplies an imaginary number and a complex number. |
Multiply( | Multiplies two complex numbers. |
Subtraction( | Subtracts an imaginary number from a complex number. |
Subtraction( | Subtracts an imaginary number from a real number. |
Subtraction( | Subtracts a real number from an imaginary number. |
Subtraction( | Subtracts a complex number from an imaginary number. |
Subtraction( | Subtracts two complex numbers. |
Unary | Negates an imaginary number. |
Unary | Applies the unary plus operator to an imaginary number. |
Fields
I | Represents the square root of -1. |
Infinity | Represents complex infinity. |
NaN | Represents complex NaN, or Not a Number. |
Zero | Represents the complex number zero. |