IGLib
1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
|
Class representing general complex numbers. More...
Public Member Functions | |
ComplexClass () | |
Default (parameter-less) constructor, creates 0+0*i. More... | |
ComplexClass (double real, double imaginary) | |
Initializes a complex number with specified real and imaginary part. More... | |
ComplexClass (complex a) | |
Initializes a complex number with another complex number of type complex. More... | |
ComplexClass (double a) | |
Initializes a complex number with another complex number of type complex. More... | |
ComplexClass (ComplexClass a) | |
Initializes a complex number with another complex number. More... | |
override string | ToString () |
Returns a string representation of the complec number in the form "(2.3+4.5*i)". More... | |
double | Absolute () |
Returns an absolute value of the complex number. More... | |
ComplexClass | Conjugate () |
Complex conjugate. More... | |
Static Public Member Functions | |
static ComplexClass | operator+ (ComplexClass a, ComplexClass b) |
Binary operator + for summation of two complex numbers. More... | |
static ComplexClass | operator- (ComplexClass a, ComplexClass b) |
Binary operator - subtraction of two complex numbers. More... | |
static ComplexClass | operator- (ComplexClass a) |
Unary operator - changing sign of a complex number. More... | |
static ComplexClass | operator* (double a, ComplexClass c) |
Left multiplication of a complex number by a real number. More... | |
static ComplexClass | operator* (ComplexClass c, double a) |
Right multiplication of a complex number by a real number. More... | |
static ComplexClass | operator* (ComplexClass a, ComplexClass b) |
Complex multiplication. More... | |
static ComplexClass | operator/ (ComplexClass a, ComplexClass b) |
Complex division. More... | |
static implicit | operator ComplexClass (double number) |
Implicit conversion from double to Complex. More... | |
static implicit | operator ComplexClass (complex complexStruct) |
Implicit conversion from complex (struct) to Complex. More... | |
static ComplexClass | Polar (double r, double fi) |
static double | Absolute (ComplexClass a) |
Returns an absolute value of the specified complex number. More... | |
static ComplexClass | Conjugate (ComplexClass a) |
Returns a complex conjugate of the argument. More... | |
static void | Example () |
Example of using the complex class. More... | |
Properties | |
complex | Base [get] |
Returns a struct of type complex that represents the same complex number as the current class. More... | |
virtual double | Re [get, protected set] |
Gets (public access) or sets (protected access) the real part of the complex number. More... | |
virtual double | Im [get, protected set] |
Gets (public access) or sets (protected access) the imaginary part of the complex number. More... | |
double | SquaredAbs [get] |
Returns squared absolute value of the current complex number. More... | |
virtual double | Abs [get] |
Gets modulus (absolute value) of the complex number. More... | |
virtual double | Fi [get] |
Argument of the complex number. More... | |
static ComplexClass | Zero [get] |
Complex constant 0 + 0*i (summation unit) More... | |
static ComplexClass | One [get] |
Complex constant 1 + 0*i (multiplication unit). More... | |
static ComplexClass | I [get] |
Complex constant 1 + 0*i (summation unit) More... | |
double | this[int index] [get, set] |
Index operator - index 0 for real part and 1 for imaginary part of a complex number. More... | |
double | this[string index] [get, set] |
Index operator where a string index defines what to get or to set. More... | |
![]() | |
double | Re [get] |
Real part of the current complex number. More... | |
double | Im [get] |
Imaginary part of the current complex number. More... | |
double | SquaredAbs [get] |
Returns squared absolute value of the current complex number. More... | |
double | Abs [get] |
Modulus (absolute value) of the current complex number. More... | |
double | Fi [get] |
Argument of the current complex number. More... | |
Private Attributes | |
complex | _base |
Static Private Attributes | |
static ComplexClass | _zero = null |
static ComplexClass | _one = null |
static ComplexClass | _i = null |
Class representing general complex numbers.
$A Igor Apr09 Mar11;
|
inline |
Default (parameter-less) constructor, creates 0+0*i.
|
inline |
Initializes a complex number with specified real and imaginary part.
real | Value assigned to the real part of the created complex number. |
imaginary | Value assigned to the imaginary part of the created complex number. |
|
inline |
Initializes a complex number with another complex number of type complex.
a | Complex number whose copy is created in this constructor. |
|
inline |
Initializes a complex number with another complex number of type complex.
a | Complex number whose copy is created in this constructor. |
|
inline |
Initializes a complex number with another complex number.
a | Complex number whose copy is created in this constructor. |
References IG.Num.ComplexClass.Im, and IG.Num.ComplexClass.Re.
|
inlinestatic |
Binary operator + for summation of two complex numbers.
References IG.Num.ComplexClass._base.
|
inlinestatic |
Binary operator - subtraction of two complex numbers.
References IG.Num.ComplexClass._base.
|
inlinestatic |
Unary operator - changing sign of a complex number.
References IG.Num.ComplexClass._base.
|
inlinestatic |
Left multiplication of a complex number by a real number.
References IG.Num.ComplexClass._base.
|
inlinestatic |
Right multiplication of a complex number by a real number.
References IG.Num.ComplexClass._base.
|
inlinestatic |
Complex multiplication.
References IG.Num.ComplexClass._base.
|
inlinestatic |
Complex division.
References IG.Num.ComplexClass._base.
|
inlinestatic |
Implicit conversion from double to Complex.
number | Number that is converted. |
|
inlinestatic |
Implicit conversion from complex (struct) to Complex.
number | Number that is converted. |
|
inlinestatic |
References IG.Num.complex.Polar().
|
inline |
Returns a string representation of the complec number in the form "(2.3+4.5*i)".
References IG.Num.complex.ToString().
Referenced by IG.Num.ComplexClass.Example().
|
inline |
Returns an absolute value of the complex number.
Implements IG.Num.IComplex.
References IG.Num.complex.Abs.
|
inlinestatic |
Returns an absolute value of the specified complex number.
a | Complex number whose absolute value is returned. |
References IG.Num.ComplexClass._base, and IG.Num.complex.Absolute().
|
inline |
Complex conjugate.
References IG.Num.complex.Conjugate().
Referenced by IG.Num.ComplexClass.Example().
|
inlinestatic |
Returns a complex conjugate of the argument.
References IG.Num.ComplexClass._base, and IG.Num.complex.Conjugate().
|
inlinestatic |
Example of using the complex class.
Complex class will be seldom used, usually the complex struct will be used instead (which is a value type).
References IG.Num.ComplexClass.Conjugate(), IG.Num.ComplexClass.ToString(), and IG.Num.ComplexRealClass.ToString().
|
private |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
get |
Returns a struct of type complex that represents the same complex number as the current class.
|
getprotected set |
Gets (public access) or sets (protected access) the real part of the complex number.
Referenced by IG.Num.ComplexClass.ComplexClass(), IG.Num.ComplexRealClass.ComplexRealClass(), and IG.Num.complex.Equals().
|
getprotected set |
Gets (public access) or sets (protected access) the imaginary part of the complex number.
Referenced by IG.Num.ComplexClass.ComplexClass(), IG.Num.ComplexRealClass.ComplexRealClass(), and IG.Num.complex.Equals().
|
get |
Returns squared absolute value of the current complex number.
|
get |
Gets modulus (absolute value) of the complex number.
|
get |
Argument of the complex number.
|
staticget |
Complex constant 0 + 0*i (summation unit)
|
staticget |
Complex constant 1 + 0*i (multiplication unit).
|
staticget |
Complex constant 1 + 0*i (summation unit)
|
getset |
Index operator - index 0 for real part and 1 for imaginary part of a complex number.
index | Integer index that can be 0 (for real part of the complex number) or 1 (for imaginary part). |
|
getset |
Index operator where a string index defines what to get or to set.
For information about possible values of index, see struct complex.
index | String that defines what to get or to set. |
Possible indices read/write (for precise informatin, see struct complex): re, Re, real, Real: real part of the complex number im, Im, imaginary, Imaginary: imaginary part of the complex number Possible indices - read only: r, R: modulus (absolute value) of the complex number fi, Fi: argument of the complex number