Base Framework
|
#include <base/math/Complex.h>
Classes | |
class | Imaginary |
class | Polar |
Public Types | |
typedef TYPE | Type |
Public Member Functions | |
Complex () noexcept | |
Complex (Type real) noexcept | |
Complex (Type real, Type imaginary) noexcept | |
Complex (const Polar &polar) noexcept | |
Complex (const Complex ©) noexcept | |
Complex & | operator= (const Complex &assign) noexcept |
Complex & | operator= (Type real) noexcept |
Type | getReal () const noexcept |
Type | getImaginary () const noexcept |
void | setReal (const Type value) noexcept |
void | setImaginary (const Type value) noexcept |
Type | getSqrModulus () const noexcept |
Polar | getPolar () const noexcept |
Type | getModulus () const noexcept |
Type | getAngle () const noexcept |
Complex | plus () const noexcept |
Complex | minus () const noexcept |
Complex | negate () const noexcept |
Complex | conjugate () const noexcept |
Complex | invert () const noexcept |
bool | operator== (const Complex &value) const noexcept |
bool | operator!= (const Complex &value) const noexcept |
Complex & | operator+= (const Complex &value) noexcept |
Complex & | operator+= (const Imaginary) noexcept |
Complex & | operator-= (const Complex &value) noexcept |
Complex & | operator-= (const Imaginary) noexcept |
Complex & | operator*= (const Complex &value) noexcept |
Complex & | operator*= (Type value) noexcept |
Complex & | operator*= (const Imaginary) noexcept |
Complex & | operator/= (Type divisor) noexcept |
Complex & | operator/= (const Complex &divisor) noexcept |
Complex & | operator/= (const Imaginary) noexcept |
Complex | operator+ () const noexcept |
Complex | operator- () const noexcept |
Static Public Member Functions | |
static Complex | sqrt (const Complex &x) noexcept |
static Complex | exp (const Complex &x) noexcept |
static Complex | ln (const Complex &x) noexcept |
static Complex | pow (const Type x, const Complex &y) noexcept |
static Complex | sin (const Complex &x) noexcept |
static Complex | asin (const Complex &x) noexcept |
static Complex | cos (const Complex &x) noexcept |
static Complex | acos (const Complex &x) noexcept |
static Complex | tan (const Complex &x) noexcept |
static Complex | atan (const Complex &x) noexcept |
static Complex | sinh (const Complex &x) noexcept |
static Complex | asinh (const Complex &x) noexcept |
static Complex | cosh (const Complex &x) noexcept |
static Complex | acosh (const Complex &x) noexcept |
static Complex | tanh (const Complex &x) noexcept |
static Complex | atanh (const Complex &x) noexcept |
Public Attributes | |
Type | real = 0 |
TYPE | imaginary = 0 |
Static Public Attributes | |
static const Imaginary | I |
static const Complex | ZERO |
static const Complex | ONE |
static const Complex | MINUS_ONE |
static const Complex | II |
static constexpr Type | _ONE = 1 |
Related Functions | |
(Note that these are not member functions.) | |
template<typename TYPE > | |
FormatOutputStream & | operator<< (FormatOutputStream &stream, const Complex< TYPE > &value) |
Complex number.
Complex number represented by real and imaginary parts.
Initializes complex number as (0, 0).
Initializes complex number with the specified real part. The imaginary part is initialized to zero.
real | The real part. |
Initializes complex number of the specified real and imaginary parts.
real | The desired real part. |
imaginary | The desired imaginary part. |
Initializes complex number of other complex number.
Conjugates this number.
Returns the angle of the complex number.
Returns the imaginary part of the complex number.
Returns the modulus of the complex number.
Returns the real part of the complex number.
Returns the square of the modulus of the complex number.
Inverts this number.
Negates this number.
|
inlinenoexcept |
Multiplies this number with the specified value.
value | The multiplicator. |
Multiplies this number with the specified value.
value | The multiplicator. |
Multiplies this number with the specified value.
value | The multiplicator. |
|
inlinenoexcept |
Adds the specified number to this number.
value | The value to be added. |
Adds the specified number to this number.
value | The value to be added. |
|
inlinenoexcept |
Subtracts the specified complex from this number.
value | The value to be subtracted. |
Subtracts the specified complex from this number.
value | The value to be subtracted. |
|
inlinenoexcept |
Divides this number with the specified value.
value | The divisor. |
Divides this number with the specified value.
value | The divisor. |
|
inlinenoexcept |
Assignment of complex number by complex number.
Assignment of complex number by real number.
|
inlinenoexcept |
Returns true if the numbers are equal.
value | Complex number to be compared. |
Sets the imaginary part of the complex number.
Sets the real part of the complex number.
|
related |
Writes a string representation of the complex number to a format stream "(real[+-]imaginaryi)".
Imaginary symbol. Use for faster math operations.
TYPE Complex< TYPE >::imaginary = 0 |
The imaginary part the complex number.