Class for storing complex numbers as two doubles representing real and imaginary part, respectively. More...
Public Member Functions | |
Complex () | |
Default constructor. Sets number to 0 + 0i. More... | |
Complex (double realPart, double imaginaryPart) | |
Specific constructor, setting number to given real and imaginary part. More... | |
void | add (Complex c) |
Utility to add a complex number c to this complex number. More... | |
void | sub (Complex c) |
Utility to subtract a complex number c from this complex number. More... | |
void | mul (Complex c) |
Utility to multiply a complex number c to this complex number. More... | |
void | div (Complex c) |
Utility to divide a complex number by complex number c. More... | |
void | add (double z) |
Utility to add a double to this complex number. More... | |
void | sub (double z) |
Utility to subtract a double from this complex number. More... | |
void | mul (double z) |
Utility to multiply this complex number by a double. More... | |
void | div (double z) |
Utility to divide this complex number by a double. More... | |
void | setReal (double realPart) |
Sets the real part of this number. More... | |
void | setImag (double imaginaryPart) |
Sets the imaginary part of this number. More... | |
double | getReal () |
Returns the real part of this number. More... | |
double | getImag () |
Returns the imaginary part of this number. More... | |
Class for storing complex numbers as two doubles representing real and imaginary part, respectively.
Class for storing complex numbers as two doubles representing real and imaginary part, respectively. Includes basic math operations (addition, subtraction, multiplication, division)
utils.Complex.Complex | ( | ) |
Default constructor. Sets number to 0 + 0i.
Default constructor. Sets number to 0 + 0i
utils.Complex.Complex | ( | double | realPart, |
double | imaginaryPart | ||
) |
Specific constructor, setting number to given real and imaginary part.
Specific constructor, setting number to given real and imaginary part
realPart | Number to be assigned to the 'Real' part of this complex number |
imaginaryPart | Number to be assigned to the 'Imaginary' part of this complex number |
void utils.Complex.add | ( | Complex | c | ) |
Utility to add a complex number c to this complex number.
Utility to add a complex number c to this complex number
c | Complex number being added to this complex number |
void utils.Complex.add | ( | double | z | ) |
Utility to add a double to this complex number.
Utility to add a double to this complex number
z | Double being added to this number |
void utils.Complex.div | ( | Complex | c | ) |
Utility to divide a complex number by complex number c.
Utility to divide a complex number by this complex number c
c | Complex number by which this object is being divided |
void utils.Complex.div | ( | double | z | ) |
Utility to divide this complex number by a double.
Utility to divide this complex number by a double
z | Double being divided into this complex number |
double utils.Complex.getImag | ( | ) |
Returns the imaginary part of this number.
Returns the imaginary part of this number
double utils.Complex.getReal | ( | ) |
Returns the real part of this number.
Returns the real part of this number
void utils.Complex.mul | ( | Complex | c | ) |
Utility to multiply a complex number c to this complex number.
Utility to multiply a complex number c to this complex number
c | Complex number being multiplied to this complex number |
void utils.Complex.mul | ( | double | z | ) |
Utility to multiply this complex number by a double.
Utility to multiply this complex number by a double
z | Double being multiplied to this complex number |
void utils.Complex.setImag | ( | double | imaginaryPart | ) |
Sets the imaginary part of this number.
Sets the imaginary part of this number
imaginaryPart | Double value to set the imaginary part of this number too |
void utils.Complex.setReal | ( | double | realPart | ) |
Sets the real part of this number.
Sets the real part of this number
realPart | Double value to set the real part of this number too |
void utils.Complex.sub | ( | Complex | c | ) |
Utility to subtract a complex number c from this complex number.
Utility to subtract a complex number c from this complex number
c | Complex number being subtracted from this complex number |
void utils.Complex.sub | ( | double | z | ) |
Utility to subtract a double from this complex number.
Utility to subtract a double from this complex number
z | Double being subtracted from this number |