|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ComplexNumber
Class representing a complex number.
Field Summary | |
double |
imaginary
The imaginary part of the complex number. |
double |
real
The real part of the complex number. |
Constructor Summary | |
ComplexNumber()
Default no-arg constructor. |
|
ComplexNumber(ComplexNumber c)
Constructor taking a ComplexNumber to make an identical copy. |
|
ComplexNumber(double r,
double i)
Constrctor taking two doubles, the real and the imaginary values. |
Method Summary | |
static ComplexNumber |
cDif(ComplexNumber z1,
ComplexNumber z2)
Method to subtract a complex number from another. |
static ComplexNumber |
cDiv(ComplexNumber z1,
ComplexNumber z2)
Method to divide a complex number by another. |
static ComplexNumber |
cExp(ComplexNumber z)
Method to obtain the exp of a complex number. |
static ComplexNumber |
cMult(ComplexNumber z1,
ComplexNumber z2)
Method to multiply two complex numbers together. |
static ComplexNumber |
cSum(ComplexNumber z1,
ComplexNumber z2)
Method to add two complex numbers together. |
double |
magnitude()
Method to obtain the magnitude of the complex number. |
double |
phaseAngle()
Method to obtain the phase angle (in radians) of the complex number. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public double real
public double imaginary
Constructor Detail |
public ComplexNumber()
public ComplexNumber(double r, double i)
r
- A double representing the real value.i
- A double representing the imaginary value.public ComplexNumber(ComplexNumber c)
c
- ComplexNumber to be copied.Method Detail |
public double magnitude()
public double phaseAngle()
public static ComplexNumber cExp(ComplexNumber z)
ComplexNumber
- input.public static ComplexNumber cMult(ComplexNumber z1, ComplexNumber z2)
z1
- ComplexNumber.z2
- ComlexNumber.public static ComplexNumber cSum(ComplexNumber z1, ComplexNumber z2)
z1
- ComplexNumber.z2
- ComlexNumber.public static ComplexNumber cDiv(ComplexNumber z1, ComplexNumber z2)
z1
- ComplexNumber.z2
- ComlexNumber.public static ComplexNumber cDif(ComplexNumber z1, ComplexNumber z2)
z1
- ComplexNumber.z2
- ComlexNumber.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |