#include <icomplex.h>
This class is used by those utility kits where complex numbers are required.
Public Member Functions | |
Complex (void) | |
Default Constructor. | |
Complex (double r) | |
Initialising constructor. | |
Complex (double r, double i) | |
Initialising constructor. | |
double | abs (void) |
Returns the absolute value of the cumplex number. | |
double | arg (void) |
Returns the argument of the complex number in the range [0, 2*PI]. | |
Public Attributes | |
double | real |
The data member holding the real part. | |
double | imag |
The data member holding the imaginary part. | |
Friends | |
Complex | operator+ (Complex c1, Complex c2) |
Overloaded operator + implementing the addition of two complex numbers. | |
Complex | operator+ (Complex c, double r) |
Overloaded operator + implementing the addition of a complex number and a real number. | |
Complex | operator+ (double r, Complex c) |
Overloaded operator + implementing the addition of a real number and a complex number. | |
Complex | operator- (Complex c1, Complex c2) |
Overloaded operator - implementing the subtarction of a complex number by another complex number. | |
Complex | operator- (Complex c, double r) |
Overloaded operator - implementing the subtraction of a complex number by a real number. | |
Complex | operator- (double r, Complex c) |
Overloaded operator - implementing the subtraction of a real number by a complex number. | |
Complex | operator * (Complex c1, Complex c2) |
Overloaded operator * implementing the multiplication of two complex numbers. | |
Complex | operator * (Complex c, double r) |
Overloaded operator * implementing the multiplication of a complex number and a real number. | |
Complex | operator * (double r, Complex c) |
Overloaded operator * implementing the multiplication of a real number and a complex number. | |
Complex | operator/ (Complex c, double r) |
Overloaded operator / implementing the division of a complex number by a real number. | |
Complex | operator/ (Complex c1, Complex c2) |
Overloaded operator / implementing the division of a complex number by another complex number. |
|
Default Constructor. Initialises real and imag to zero. This class does not require any copy constructor or a destructor. |
|
Initialising constructor. Initialises real to r and imag to zero. |
|
Initialising constructor. Initialises real to r and imag to i. |