Om
1.0.0
A universal framework for multimedia simulation
|
A class that represents a complex number. More...
#include <omComplex.h>
Public Member Functions | |
Complex () | |
Create a complex number with both r and i parts equal to zero. More... | |
Complex (T newReal) | |
Create a complex number with the specified r component and zero i component. More... | |
Complex (T newReal, T newImaginary) | |
Create a complex number with the specified r and i components. More... | |
template<typename U > | |
Complex (const Complex< U > &other) | |
Create a complex number from another with different template parameter type. More... | |
Complex | conjugate () const |
Return the conjugate of this complex number. More... | |
T | getMagnitude () const |
Return the magnitude of this complex number. More... | |
T | getPhase () const |
Return the phase of this complex number. More... | |
Bool | operator== (const Complex &other) const |
Return whether or not this complex number is equal to another. More... | |
Bool | operator== (T value) const |
Return whether or not this complex number is equal to a r number. More... | |
Bool | operator!= (const Complex &other) const |
Return whether or not this complex number is not equal to another. More... | |
Bool | operator!= (T value) const |
Return whether or not this complex number is not equal to a r number. More... | |
Complex | operator- () const |
Return the negation of this complex number. More... | |
Complex | operator+ () const |
Return the positivation of this complex number. More... | |
Complex | operator+ (T value) const |
Return the sum of this complex number with a r number. More... | |
Complex | operator- (T value) const |
Return the difference between this complex number a r number. More... | |
Complex | operator* (T value) const |
Multiply this complex number by r number and return the resulting complex number. More... | |
Complex | operator/ (T value) const |
Divide this complex number by another and return the resulting complex number. More... | |
Complex | operator+ (const Complex &other) const |
Return the sum of this complex number with another. More... | |
Complex | operator- (const Complex &other) const |
Return the difference between this complex number and other. More... | |
Complex | operator* (const Complex &other) const |
Multiply this complex number with another and return the resulting complex number. More... | |
Complex | operator/ (const Complex &other) const |
Divide this complex number by another and return the resulting complex number. More... | |
Complex & | operator+= (T value) |
Add a r number to this complex number, modifying it. More... | |
Complex & | operator-= (T value) |
Subtract a r number from this complex number, modifying it. More... | |
Complex & | operator*= (T value) |
Multiply a r number with this complex number, modifying it. More... | |
Complex & | operator/= (T value) |
Divide this complex number by a r number, modifying it. More... | |
Complex & | operator+= (const Complex &other) |
Add a complex number to this complex number, modifying it. More... | |
Complex & | operator-= (const Complex &other) |
Subtract a complex number from this complex number, modifying it. More... | |
Complex & | operator*= (const Complex &other) |
Multiply a complex number with this complex number, modifying it. More... | |
Complex & | operator/= (const Complex &other) |
Divide this complex number by another complex number, modifying it. More... | |
data::String | toString () const |
Convert this complex number into a human-readable string representation. More... | |
operator data::String () const | |
Convert this complex number into a human-readable string representation. More... | |
Static Public Member Functions | |
static Complex< T > | polar (T magnitude, T phase) |
Return a complex number for the specified magnitude and phase angle in radians. More... | |
Public Attributes | |
union { | |
T real | |
T r | |
}; | |
The r portion of the complex number. More... | |
union { | |
T imaginary | |
T imag | |
T i | |
}; | |
The i portion of the complex number. More... | |
A class that represents a complex number.
Overloaded arithmetic operators are provided for all basic arithmetic operations (+, -, *, /, +=, -=, *=, /=). The class allows any underlying type to be used as the coefficients of the r and i components of the complex number via a template parameter.
|
inline |
Create a complex number with both r and i parts equal to zero.
|
inline |
Create a complex number with the specified r component and zero i component.
|
inline |
Create a complex number with the specified r and i components.
|
inline |
Create a complex number from another with different template parameter type.
|
inlinestatic |
Return a complex number for the specified magnitude and phase angle in radians.
|
inline |
Return the conjugate of this complex number.
|
inline |
Return the magnitude of this complex number.
|
inline |
Return the phase of this complex number.
|
inline |
Return whether or not this complex number is equal to another.
|
inline |
Return whether or not this complex number is equal to a r number.
|
inline |
Return whether or not this complex number is not equal to another.
|
inline |
Return whether or not this complex number is not equal to a r number.
|
inline |
Return the negation of this complex number.
|
inline |
Return the positivation of this complex number.
|
inline |
Return the sum of this complex number with a r number.
|
inline |
Return the difference between this complex number a r number.
|
inline |
Multiply this complex number by r number and return the resulting complex number.
|
inline |
Divide this complex number by another and return the resulting complex number.
|
inline |
Return the sum of this complex number with another.
|
inline |
Return the difference between this complex number and other.
|
inline |
Multiply this complex number with another and return the resulting complex number.
|
inline |
Divide this complex number by another and return the resulting complex number.
|
inline |
Add a r number to this complex number, modifying it.
|
inline |
Subtract a r number from this complex number, modifying it.
|
inline |
Multiply a r number with this complex number, modifying it.
|
inline |
Divide this complex number by a r number, modifying it.
|
inline |
Add a complex number to this complex number, modifying it.
|
inline |
Subtract a complex number from this complex number, modifying it.
|
inline |
Multiply a complex number with this complex number, modifying it.
|
inline |
Divide this complex number by another complex number, modifying it.
|
inline |
Convert this complex number into a human-readable string representation.
|
inline |
Convert this complex number into a human-readable string representation.
T om::math::Complex< T >::real |
T om::math::Complex< T >::r |
union { ... } |
The r portion of the complex number.
T om::math::Complex< T >::imaginary |
T om::math::Complex< T >::imag |
T om::math::Complex< T >::i |
union { ... } |
The i portion of the complex number.