Class Complex
Represents a complex double-precision doubleing point number.
Inheritance
Inherited Members
Namespace: System.Dynamic.ExpandoObject
Assembly: Arithmetica.dll
Syntax
[Serializable]
public class Complex : ICloneable
Constructors
Complex(Complex)
Initializes a new instance of the Complex class using values from a given complex instance.
Declaration
public Complex(Complex c)
Parameters
Complex
c
A complex number to get values from. |
Complex(Double, Double)
Initializes a new instance of the Complex class using given real and imaginary values.
Declaration
public Complex(double real, double imaginary)
Parameters
System.Double
real
Real value. |
System.Double
imaginary
Imaginary value. |
Fields
ImaginaryOne
A double-precision complex number that represents the squere root of (-1).
Declaration
public static readonly Complex ImaginaryOne
Field Value
Complex
|
One
A double-precision complex number that represents one.
Declaration
public static readonly Complex One
Field Value
Complex
|
Zero
A double-precision complex number that represents zero.
Declaration
public static readonly Complex Zero
Field Value
Complex
|
Properties
Argument
Gets or sets the argument of the complex number.
Declaration
public double Argument { get; set; }
Property Value
System.Double
A double-precision doubleing-point number. |
Remarks
See http://mathworld.wolfram.com/ComplexArgument.html for further details.
Conjugate
Gets or sets the conjugate of the complex number.
Declaration
public Complex Conjugate { get; }
Property Value
Complex
A Complex instance. |
Imaginary
Gets or sets the imaginary value of the complex number.
Declaration
public double Imaginary { get; set; }
Property Value
System.Double
The imaginary value of this complex number. |
IsImaginary
Gets a value indicating the complex number is imaginary (Its real value is zero).
Declaration
public bool IsImaginary { get; }
Property Value
System.Boolean
A System.Boolean. |
IsReal
Gets a value indicating the complex number is real (Its imaginary value is zero).
Declaration
public bool IsReal { get; }
Property Value
System.Boolean
A System.Boolean. |
Modulus
Gets the the modulus of the complex number.
Declaration
public double Modulus { get; }
Property Value
System.Double
A double-precision doubleing-point number. |
Remarks
See http://mathworld.wolfram.com/ComplexModulus.html for further details.
ModulusSquared
Gets the squared modulus of the complex number.
Declaration
public double ModulusSquared { get; }
Property Value
System.Double
A double-precision doubleing-point number. |
Remarks
See http://mathworld.wolfram.com/ComplexModulus.html for further details.
Real
Gets or sets the real value of the complex number.
Declaration
public double Real { get; set; }
Property Value
System.Double
The real value of this complex number. |
Methods
Abs(Complex)
Find the absolute value for the complex variable
Declaration
public static double Abs(Complex complex)
Parameters
Complex
complex
The complex. |
Returns
System.Double
|
Acos(Complex)
Acosh(Complex)
Acot(Complex)
Acoth(Complex)
Acsc(Complex)
Acsch(Complex)
Add(Complex, Complex)
Adds two complex numbers.
Declaration
public static Complex Add(Complex left, Complex right)
Parameters
Complex
left
A Complex instance. |
Complex
right
A Complex instance. |
Returns
Complex
A new Complex instance containing the sum. |
Remarks
See http://mathworld.wolfram.com/ComplexAddition.html for further details.
Add(Complex, Complex, ref Complex)
Adds two complex numbers and put the result in the third complex number.
Declaration
public static void Add(Complex left, Complex right, ref Complex result)
Parameters
Complex
left
A Complex instance. |
Complex
right
A Complex instance. |
Complex
result
A Complex instance to hold the result. |
Remarks
See http://mathworld.wolfram.com/ComplexAddition.html for further details.
Add(Complex, Double)
Adds a complex number and a scalar.
Declaration
public static Complex Add(Complex complex, double scalar)
Parameters
Complex
complex
A Complex instance. |
System.Double
scalar
A double-precision doubleing-point value. |
Returns
Complex
A new Complex instance containing the sum. |
Add(Complex, Double, ref Complex)
Adds a complex number and a scalar and put the result into another complex.
Declaration
public static void Add(Complex complex, double scalar, ref Complex result)
Parameters
Complex
complex
A Complex instance. |
System.Double
scalar
A double-precision doubleing-point value. |
Complex
result
A Complex instance to hold the result. |
ApproxEqual(Complex, Complex)
Tests whether two complex numbers are approximately equal using default tolerance value.
Declaration
public static bool ApproxEqual(Complex left, Complex right)
Parameters
Complex
left
A Complex instance. |
Complex
right
A Complex instance. |
Returns
System.Boolean
true if the two vectors are approximately equal; otherwise, false. |
ApproxEqual(Complex, Complex, Double)
Tests whether two complex numbers are approximately equal given a tolerance value.
Declaration
public static bool ApproxEqual(Complex left, Complex right, double tolerance)
Parameters
Complex
left
A Complex instance. |
Complex
right
A Complex instance. |
System.Double
tolerance
The tolerance value used to test approximate equality. |
Returns
System.Boolean
true if the two vectors are approximately equal; otherwise, false. |
Asec(Complex)
Asech(Complex)
Asin(Complex)
Asinh(Complex)
Atan(Complex)
Atanh(Complex)
Clone()
Creates an exact copy of this Complex object.
Declaration
public Complex Clone()
Returns
Complex
The Complex object this method creates. |
Cos(Complex)
Calculates the cosine of the specified complex number.
Declaration
public static Complex Cos(Complex complex)
Parameters
Complex
complex
A Complex instance. |
Returns
Complex
The cosine of |
Cosh(Complex)
Calculates the hyperbolic cosine of the specified complex number.
Declaration
public static Complex Cosh(Complex complex)
Parameters
Complex
complex
A Complex instance. |
Returns
Complex
Returns the hyperbolic cosine of the specified complex number. |
Cot(Complex)
Calculates the cotangent of the specified complex number.
Declaration
public static Complex Cot(Complex complex)
Parameters
Complex
complex
A Complex instance. |
Returns
Complex
The cotangent of |
Coth(Complex)
Calculates the hyperbolic cotangent of the specified complex number.
Declaration
public static Complex Coth(Complex complex)
Parameters
Complex
complex
A Complex instance. |
Returns
Complex
Returns the hyperbolic cotangent of the specified complex number. |
Csc(Complex)
Calculates the cosecant of the specified complex number.
Declaration
public static Complex Csc(Complex complex)
Parameters
Complex
complex
A Complex instance. |
Returns
Complex
The cosecant of |
Csch(Complex)
Calculates the hyperbolic cosecant of the specified complex number.
Declaration
public static Complex Csch(Complex complex)
Parameters
Complex
complex
A Complex instance. |
Returns
Complex
Returns the hyperbolic cosecant of the specified complex number. |
Divide(Complex, Complex)
Divides a complex by a complex.
Declaration
public static Complex Divide(Complex left, Complex right)
Parameters
Complex
left
A Complex instance. |
Complex
right
A Complex instance. |
Returns
Complex
A new Complex instance containing the result. |
Remarks
See http://mathworld.wolfram.com/Complexivision.html for further details.
Divide(Complex, Complex, ref Complex)
Divides a complex by a complex and put the result in a third complex number.
Declaration
public static void Divide(Complex left, Complex right, ref Complex result)
Parameters
Complex
left
A Complex instance. |
Complex
right
A Complex instance. |
Complex
result
A Complex instance to hold the result. |
Remarks
See http://mathworld.wolfram.com/Complexivision.html for further details.
Divide(Complex, Double)
Divides a complex by a scalar.
Declaration
public static Complex Divide(Complex complex, double scalar)
Parameters
Complex
complex
A Complex instance. |
System.Double
scalar
A double-precision doubleing-point value. |
Returns
Complex
A new Complex instance containing the result. |
Divide(Complex, Double, ref Complex)
Divides a complex by a scalar and put the result into another complex number.
Declaration
public static void Divide(Complex complex, double scalar, ref Complex result)
Parameters
Complex
complex
A Complex instance. |
System.Double
scalar
A double-precision doubleing-point value. |
Complex
result
A Complex instance to hold the result. |
Divide(Double, Complex)
Divides a scalar by a complex.
Declaration
public static Complex Divide(double scalar, Complex complex)
Parameters
System.Double
scalar
A double-precision doubleing-point value. |
Complex
complex
A Complex instance. |
Returns
Complex
A new Complex instance containing the result. |
Divide(Double, Complex, ref Complex)
Divides a scalar by a complex and put the result into another complex number.
Declaration
public static void Divide(double scalar, Complex complex, ref Complex result)
Parameters
System.Double
scalar
A double-precision doubleing-point value. |
Complex
complex
A Complex instance. |
Complex
result
A Complex instance to hold the result. |
Equals(Object)
Returns a value indicating whether this instance is equal to the specified object.
Declaration
public override bool Equals(object obj)
Parameters
System.Object
obj
An object to compare to this instance. |
Returns
System.Boolean
true if |
Overrides
Exp(Complex)
Calculates the exponential of a specified complex number.
Declaration
public static Complex Exp(Complex complex)
Parameters
Complex
complex
A Complex instance. |
Returns
Complex
The exponential of the complex number given in |
GetHashCode()
Returns the hashcode for this instance.
Declaration
public override int GetHashCode()
Returns
System.Int32
A 32-bit signed integer hash code. |
Overrides
Log(Complex)
Calculates the logarithm of a specified complex number. Calculates the natural (base e) logarithm of a specified complex number.
Declaration
public static Complex Log(Complex complex)
Parameters
Complex
complex
A Complex instance. |
Returns
Complex
The natural (base e) logarithm of the complex number given in |
Multiply(Complex, Complex)
Multiplies two complex numbers.
Declaration
public static Complex Multiply(Complex left, Complex right)
Parameters
Complex
left
A Complex instance. |
Complex
right
A Complex instance. |
Returns
Complex
A new Complex instance containing the result. |
Remarks
See http://mathworld.wolfram.com/ComplexMultiplication.html for further details.
Multiply(Complex, Complex, ref Complex)
Multiplies two complex numbers and put the result in a third complex number.
Declaration
public static void Multiply(Complex left, Complex right, ref Complex result)
Parameters
Complex
left
A Complex instance. |
Complex
right
A Complex instance. |
Complex
result
A Complex instance to hold the result. |
Remarks
See http://mathworld.wolfram.com/ComplexMultiplication.html for further details.
Multiply(Complex, Double)
Multiplies a complex by a scalar.
Declaration
public static Complex Multiply(Complex complex, double scalar)
Parameters
Complex
complex
A Complex instance. |
System.Double
scalar
A double-precision doubleing-point value. |
Returns
Complex
A new Complex instance containing the result. |
Multiply(Complex, Double, ref Complex)
Multiplies a complex by a scalar and put the result into another complex number.
Declaration
public static void Multiply(Complex complex, double scalar, ref Complex result)
Parameters
Complex
complex
A Complex instance. |
System.Double
scalar
A double-precision doubleing-point value. |
Complex
result
A Complex instance to hold the result. |
Negate(Complex)
Negates a complex number.
Declaration
public static Complex Negate(Complex complex)
Parameters
Complex
complex
A Complex instance. |
Returns
Complex
A new Complex instance containing the negated values. |
Normalize()
Scale the complex number to modulus 1.
Declaration
public void Normalize()
Parse(String)
Converts the specified string to its Complex equivalent.
Declaration
public static Complex Parse(string value)
Parameters
System.String
value
A string representation of a Complex. |
Returns
Complex
A Complex that represents the complex number specified by the |
Pow(Complex, Complex)
Calculates a specified complex number raised by a specified power.
Declaration
public static Complex Pow(Complex complex, Complex power)
Parameters
Complex
complex
A Complex representing the number to raise. |
Complex
power
A Complex representing the power. |
Returns
Complex
The complex |
Sec(Complex)
Calculates the secant of the specified complex number.
Declaration
public static Complex Sec(Complex complex)
Parameters
Complex
complex
A Complex instance. |
Returns
Complex
The secant of |
Sech(Complex)
Calculates the hyperbolic secant of the specified complex number.
Declaration
public static Complex Sech(Complex complex)
Parameters
Complex
complex
A Complex instance. |
Returns
Complex
Returns the hyperbolic secant of the specified complex number. |
Sin(Complex)
Calculates the sine of the specified complex number.
Declaration
public static Complex Sin(Complex complex)
Parameters
Complex
complex
A Complex instance. |
Returns
Complex
The sine of |
Sinh(Complex)
Calculates the hyperbolic sine of the specified complex number.
Declaration
public static Complex Sinh(Complex complex)
Parameters
Complex
complex
A Complex instance. |
Returns
Complex
Returns the hyperbolic sine of the specified complex number. |
Sqrt(Complex)
Calculates the square root of a complex number.
Declaration
public static Complex Sqrt(Complex complex)
Parameters
Complex
complex
A Complex instance. |
Returns
Complex
The square root of the complex number given in |
Remarks
See http://mathworld.wolfram.com/SquareRoot.html for further details.
Square(Complex)
Calculates the square of the specified complex number.
Declaration
public static Complex Square(Complex complex)
Parameters
Complex
complex
A Complex instance. |
Returns
Complex
The square of the given complex number. |
Subtract(Complex, Complex)
Subtracts a complex from a complex.
Declaration
public static Complex Subtract(Complex left, Complex right)
Parameters
Complex
left
A Complex instance. |
Complex
right
A Complex instance. |
Returns
Complex
A new Complex instance containing the difference. |
Remarks
See http://mathworld.wolfram.com/ComplexSubtraction.html for further details.
Subtract(Complex, Complex, ref Complex)
Subtracts a complex from a complex and put the result in the third complex number.
Declaration
public static void Subtract(Complex left, Complex right, ref Complex result)
Parameters
Complex
left
A Complex instance. |
Complex
right
A Complex instance. |
Complex
result
A Complex instance to hold the result. |
Remarks
See http://mathworld.wolfram.com/ComplexSubtraction.html for further details.
Subtract(Complex, Double)
Subtracts a scalar from a complex.
Declaration
public static Complex Subtract(Complex complex, double scalar)
Parameters
Complex
complex
A Complex instance. |
System.Double
scalar
A double-precision doubleing-point value. |
Returns
Complex
A new Complex instance containing the difference. |
Subtract(Complex, Double, ref Complex)
Subtracts a scalar from a complex and put the result into another complex.
Declaration
public static void Subtract(Complex complex, double scalar, ref Complex result)
Parameters
Complex
complex
A Complex instance. |
System.Double
scalar
A double-precision doubleing-point value. |
Complex
result
A Complex instance to hold the result. |
Subtract(Double, Complex)
Subtracts a complex from a scalar.
Declaration
public static Complex Subtract(double scalar, Complex complex)
Parameters
System.Double
scalar
A double-precision doubleing-point value. |
Complex
complex
A Complex instance. |
Returns
Complex
A new Complex instance containing the difference. |
Subtract(Double, Complex, ref Complex)
Subtracts a complex from a scalar and put the result into another complex.
Declaration
public static void Subtract(double scalar, Complex complex, ref Complex result)
Parameters
System.Double
scalar
A double-precision doubleing-point value. |
Complex
complex
A Complex instance. |
Complex
result
A Complex instance to hold the result. |
Tan(Complex)
Calculates the tangent of the specified complex number.
Declaration
public static Complex Tan(Complex complex)
Parameters
Complex
complex
A Complex instance. |
Returns
Complex
The tangent of |
Tanh(Complex)
Calculates the hyperbolic tangent of the specified complex number.
Declaration
public static Complex Tanh(Complex complex)
Parameters
Complex
complex
A Complex instance. |
Returns
Complex
Returns the hyperbolic tangent of the specified complex number. |
ToString()
Returns a string representation of this object.
Declaration
public override string ToString()
Returns
System.String
A string representation of this object. |
Overrides
TryParse(String, out Complex)
Converts the specified string to its Complex equivalent. A return value indicates whether the conversion succeeded or failed.
Declaration
public static bool TryParse(string value, out Complex result)
Parameters
System.String
value
A string representation of a Complex. |
Complex
result
When this method returns, if the conversion succeeded,
contains a Complex representing the complex number specified by |
Returns
System.Boolean
true if value was converted successfully; otherwise, false. |
Operators
Addition(Complex, Complex)
Adds two complex numbers.
Declaration
public static Complex operator +(Complex left, Complex right)
Parameters
Complex
left
A Complex instance. |
Complex
right
A Complex instance. |
Returns
Complex
A new Complex instance containing the sum. |
Addition(Complex, Double)
Adds a complex number and a scalar.
Declaration
public static Complex operator +(Complex complex, double scalar)
Parameters
Complex
complex
A Complex instance. |
System.Double
scalar
A scalar. |
Returns
Complex
A new Complex instance containing the sum. |
Addition(Double, Complex)
Adds a complex number and a scalar.
Declaration
public static Complex operator +(double scalar, Complex complex)
Parameters
System.Double
scalar
A scalar. |
Complex
complex
A Complex instance. |
Returns
Complex
A new Complex instance containing the sum. |
Division(Complex, Complex)
Divides a complex by a complex.
Declaration
public static Complex operator /(Complex left, Complex right)
Parameters
Complex
left
A Complex instance. |
Complex
right
A Complex instance. |
Returns
Complex
A new Complex instance containing the result. |
Division(Complex, Double)
Divides a complex by a scalar.
Declaration
public static Complex operator /(Complex complex, double scalar)
Parameters
Complex
complex
A Complex instance. |
System.Double
scalar
A scalar. |
Returns
Complex
A new Complex instance containing the result. |
Division(Double, Complex)
Divides a scalar by a complex.
Declaration
public static Complex operator /(double scalar, Complex complex)
Parameters
System.Double
scalar
A scalar. |
Complex
complex
A Complex instance. |
Returns
Complex
A new Complex instance containing the result. |
Equality(Complex, Complex)
Tests whether two specified complex numbers are equal.
Declaration
public static bool operator ==(Complex left, Complex right)
Parameters
Complex
left
The left-hand complex number. |
Complex
right
The right-hand complex number. |
Returns
System.Boolean
true if the two complex numbers are equal; otherwise, false. |
Implicit(Double to Complex)
Performs an implicit conversion from System.Double to Complex.
Declaration
public static implicit operator Complex(double value)
Parameters
System.Double
value
The value. |
Returns
Complex
The result of the conversion. |
Implicit(Int32 to Complex)
Performs an implicit conversion from System.Int32 to Complex.
Declaration
public static implicit operator Complex(int value)
Parameters
System.Int32
value
The value. |
Returns
Complex
The result of the conversion. |
Implicit(Single to Complex)
Performs an implicit conversion from System.Single to Complex.
Declaration
public static implicit operator Complex(float value)
Parameters
System.Single
value
The value. |
Returns
Complex
The result of the conversion. |
Inequality(Complex, Complex)
Tests whether two specified complex numbers are not equal.
Declaration
public static bool operator !=(Complex left, Complex right)
Parameters
Complex
left
The left-hand complex number. |
Complex
right
The right-hand complex number. |
Returns
System.Boolean
true if the two complex numbers are not equal; otherwise, false. |
Multiply(Complex, Complex)
Multiplies two complex numbers.
Declaration
public static Complex operator *(Complex left, Complex right)
Parameters
Complex
left
A Complex instance. |
Complex
right
A Complex instance. |
Returns
Complex
A new Complex instance containing the result. |
Multiply(Complex, Double)
Multiplies a complex by a scalar.
Declaration
public static Complex operator *(Complex complex, double scalar)
Parameters
Complex
complex
A Complex instance. |
System.Double
scalar
A scalar. |
Returns
Complex
A new Complex instance containing the result. |
Multiply(Double, Complex)
Multiplies a complex by a scalar.
Declaration
public static Complex operator *(double scalar, Complex complex)
Parameters
System.Double
scalar
A scalar. |
Complex
complex
A Complex instance. |
Returns
Complex
A new Complex instance containing the result. |
Subtraction(Complex, Complex)
Subtracts a complex from a complex.
Declaration
public static Complex operator -(Complex left, Complex right)
Parameters
Complex
left
A Complex instance. |
Complex
right
A Complex instance. |
Returns
Complex
A new Complex instance containing the difference. |
Subtraction(Complex, Double)
Subtracts a scalar from a complex.
Declaration
public static Complex operator -(Complex complex, double scalar)
Parameters
Complex
complex
A Complex instance. |
System.Double
scalar
A scalar. |
Returns
Complex
A new Complex instance containing the difference. |
Subtraction(Double, Complex)
Subtracts a complex from a scalar.
Declaration
public static Complex operator -(double scalar, Complex complex)
Parameters
System.Double
scalar
A scalar. |
Complex
complex
A Complex instance. |
Returns
Complex
A new Complex instance containing the difference. |
UnaryNegation(Complex)
Negates the complex number.
Declaration
public static Complex operator -(Complex complex)
Parameters
Complex
complex
A Complex instance. |
Returns
Complex
A new Complex instance containing the negated values. |