|
|
| phasor () |
| | Initialize as 0/0.
|
| |
|
| phasor (Type modulus, Type phase) |
| | Initialize from two real numbers.
|
| |
|
| phasor (const phasor &other) |
| | Initialize from another phasor.
|
| |
|
template<typename T > |
| | phasor (const complex< T > &z) |
| | Construct a phasor from a complex number.
|
| |
|
| phasor (Type r) |
| | Construct a phasor from a real number.
|
| |
|
phasor & | operator= (const phasor &z) |
| | Assignment operator.
|
| |
|
template<typename T > |
| phasor & | operator= (const std::array< T, 2 > &v) |
| | Assignment operator from a 2D array as {modulus, phase}.
|
| |
|
Type | Re () const |
| | Get the real part of the complex number.
|
| |
|
Type | Im () const |
| | Get the imaginary part of the complex number.
|
| |
|
phasor | conjugate () const |
| | Compute the conjugate of the complex number.
|
| |
|
Type | sqr_norm () const |
| | Compute the square norm of the complex number.
|
| |
|
Type | norm () const |
| | Compute the norm of the complex number.
|
| |
|
Type | inverse () const |
| | Compute the inverse of the complex number.
|
| |
|
phasor & | invert () |
| | Invert the complex number.
|
| |
|
Type | arg () const |
| | Get the argument of the complex number.
|
| |
| phasor | operator+ (const phasor &other) const |
| | Add two phasors.
|
| |
| phasor | operator- (const phasor &other) const |
| | Subtract two phasors.
|
| |
|
phasor | operator* (const phasor &other) const |
| | Multiply two phasors.
|
| |
|
template<typename T > |
| phasor | operator* (const complex< T > &other) const |
| | Multiply a complex number in algebraic form and a phasor.
|
| |
|
phasor | operator/ (const phasor &other) const |
| | Divide two phasors.
|
| |
|
phasor & | operator+= (const phasor &other) |
| | Add a phasor to this one.
|
| |
|
phasor & | operator-= (const phasor &other) |
| | Subtract a phasor from this one.
|
| |
|
phasor & | operator*= (const phasor &other) |
| | Multiply this phasor by another one.
|
| |
|
phasor & | operator/= (const phasor &other) |
| | Divide this phasor by another one.
|
| |
|
bool | operator== (const phasor &z) const |
| | Check whether two phasors are the same.
|
| |
|
bool | operator!= (const phasor &z) const |
| | Check whether two phasors are not the same.
|
| |
|
template<typename T = Type> |
| complex< T > | to_complex () const |
| | Transform a phasor to a complex number.
|
| |
|
template<typename T > |
| | operator complex< T > () |
| | Cast to complex.
|
| |
|
std::string | to_string (const std::string &separator=", ") const |
| | Convert the phasor to string representation.
|
| |
|
| operator std::string () |
| | Convert the phasor to string representation.
|
| |
template<typename Type = real>
class theoretica::phasor< Type >
Complex number in exponential form \(\rho e^{i \theta}\).