A representation of complex numbers. More...
#include <Common.hpp>
Public Member Functions | |
jcomplex (jdouble re, jdouble im) | |
Default constructor. More... | |
jcomplex () | |
Alternate constructor. | |
jdouble | abs () |
Gets the complex magnitude. | |
Public Attributes | |
jdouble | re |
The real part. | |
jdouble | im |
The imaginary part. | |
Friends | |
jcomplex | operator+ (const jcomplex &a, const jcomplex &b) |
Adds two complex numbers. More... | |
jcomplex | operator- (const jcomplex &a, const jcomplex &b) |
Subtracts two complex numbers. More... | |
jcomplex | operator* (const jcomplex &a, const jcomplex &b) |
Multiplies two complex numbers. More... | |
jcomplex | operator/ (const jcomplex &a, const jcomplex &b) |
Divides two complex numbers. More... | |
jcomplex & | operator+= (jcomplex &a, const jcomplex &b) |
Adds two complex numbers and mutates the left hand side. More... | |
jcomplex & | operator*= (jcomplex &a, const jcomplex &b) |
Multiplies two complex numbers and mutates the left hand side. More... | |
bool | operator< (const jcomplex &a, const jcomplex &b) |
Performs a comparison on the basis of magnitudes. More... | |
A representation of complex numbers.
|
inline |
Default constructor.
re | the real part. |
im | the imaginary part. |
Multiplies two complex numbers.
a | the left hand side. |
b | the right hand side. |
Multiplies two complex numbers and mutates the left hand side.
a | the left hand side. |
b | the right hand side. |
Adds two complex numbers.
a | the left hand side. |
b | the right hand side. |
Adds two complex numbers and mutates the left hand side.
a | the left hand side. |
b | the right hand side. |
Subtracts two complex numbers.
a | the left hand side. |
b | the right hand side. |
Divides two complex numbers.
a | the left hand side. |
b | the right hand side. |