|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectSFT.Complex
public class Complex
This class is an implementation for representing Complex numbers.
| Constructor Summary | |
|---|---|
Complex(double real,
double imaginary)
Constructs a new Complex object with real and imaginary coordinates. |
|
Complex(java.lang.Double real,
java.lang.Double imaginary)
|
|
| Method Summary | |
|---|---|
void |
addComplex(Complex complex)
Adds the given complex number to this one. |
void |
addComplex(double real,
double imaginary)
Adds the given complex number to this one. |
static Complex |
divComplex(Complex complex,
double denum)
Returns the division of the the given complex by the given double. |
double[] |
getComplexCoords()
Returns an array of two doubles, where the first element is the number's real coordinate and the second element is the number's imaginary coordinate. |
Complex |
getConjugate()
Returns the conjugate number. |
double |
getIm()
Returns the imaginary coordinate of the complex number. |
double |
getNorm()
Calculates and returns the norm of the complex number, i.e. for a+bi: |a+bi| = sqrt(a^2+b^2) |
double |
getNormSquare()
Calculates and returns the Euclidean norm square of the complex number |
double |
getRe()
Returns the real coordinate of the complex number. |
static Complex |
mulComplex(Complex complex1,
Complex complex2)
Returns the multiplication of the two given complex numbers. |
void |
setComplex(double real,
double imaginary)
Sets the real and imaginary coordinates of the number to the new given coordinates. |
java.lang.String |
toString()
Returns the string representation of the complex number in the form "a + bi". |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Complex(double real,
double imaginary)
real - The real coordinateimaginary - The imaginary coordinate
public Complex(java.lang.Double real,
java.lang.Double imaginary)
| Method Detail |
|---|
public double getRe()
public double getIm()
public double[] getComplexCoords()
public Complex getConjugate()
public java.lang.String toString()
toString in class java.lang.Objectpublic double getNorm()
public double getNormSquare()
public void setComplex(double real,
double imaginary)
real - The new real coordinate.imaginary - The new imaginary coordinate.
public void addComplex(double real,
double imaginary)
real - The real value to be added.imaginary - The imaginary value to be added.public void addComplex(Complex complex)
complex - The complex number to be added.
public static Complex mulComplex(Complex complex1,
Complex complex2)
complex1 - The first complex number for the multiplication.complex2 - The second complex number for the multiplication.
public static Complex divComplex(Complex complex,
double denum)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||