wxEcMath - Official documentation  0.6.4
Public Member Functions | Public Attributes | List of all members
wxEcComplex Class Reference

A complex number. More...

#include <ec_complex.h>

Public Member Functions

 wxEcComplex ()
 
 wxEcComplex (double real, double imaginary)
 
void FromPolar (double r, double theta)
 
double Modulus ()
 
double Argument ()
 
wxEcComplex Conjugate ()
 
wxString AsString (bool usePolarNotation=false)
 
wxEcComplex operator+ (const wxEcComplex &complex) const
 
wxEcComplex operator- (const wxEcComplex &complex) const
 
wxEcComplex operator* (const wxEcComplex &complex) const
 
wxEcComplex operator/ (const wxEcComplex &complex) const
 
bool operator== (const wxEcComplex &complex) const
 
bool operator!= (const wxEcComplex &complex) const
 

Public Attributes

double Re
 
double Im
 

Detailed Description

A complex number.

A complex number is internally represented like cartesian coordinates, ie a+ib. If you want to use a polar representation, have a look to the following code :

{
wxEcComplex a(r*cos(theta), r*sin(theta)), b, c;
b.Re = r * cos(theta);
b.Im = r * sin(theta);
c.FromPolar(r, theta);
}

Constructor & Destructor Documentation

wxEcComplex::wxEcComplex ( )
inline

The default constructor with initialization to zero.

wxEcComplex::wxEcComplex ( double  real,
double  imaginary 
)
inline

The extended constructor.

Parameters
realThe real part.
imaginaryThe imaginary part.

Member Function Documentation

double wxEcComplex::Argument ( )
inline

Returns the argument of the complex number.

Remarks
(0,0) will return 0 even if the value should be undefined.
wxString wxEcComplex::AsString ( bool  usePolarNotation = false)
inline

Displays the complex number as string.

Parameters
usePolarNotationfalse will return a+ib, true will return r.e^ti
wxEcComplex wxEcComplex::Conjugate ( )
inline

Returns the complex conjugate of the complex number.

void wxEcComplex::FromPolar ( double  r,
double  theta 
)
inline

Sets the value of the complex number from a polar couple (r,theta).

double wxEcComplex::Modulus ( )
inline

Returns the absolute value of the complex number.

bool wxEcComplex::operator!= ( const wxEcComplex complex) const
inline

Operator to compare two complex numbers. It checks if Re!=Re or Im!=Im.

wxEcComplex wxEcComplex::operator* ( const wxEcComplex complex) const
inline

Operator to multiply two complex numbers.

wxEcComplex wxEcComplex::operator+ ( const wxEcComplex complex) const
inline

Operator to sum two complex numbers.

wxEcComplex wxEcComplex::operator- ( const wxEcComplex complex) const
inline

Operator to substract two complex numbers.

wxEcComplex wxEcComplex::operator/ ( const wxEcComplex complex) const
inline

Operator to divide two complex numbers. Check against division by zero is not performed.

bool wxEcComplex::operator== ( const wxEcComplex complex) const
inline

Operator to compare two complex numbers. It checks if Re==Re and Im==Im.

Member Data Documentation

double wxEcComplex::Im

The imaginary part of the number.

double wxEcComplex::Re

The real part of the number.


The documentation for this class was generated from the following file:



Documentation generated with Doxygen 1.8.10
Hosted on :
Get wxEcMath at SourceForge.net