|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object marf.math.ComplexNumber
public final class ComplexNumber
Implements complex number arithmetic.
$Id: ComplexNumber.java,v 1.3 2007/12/18 03:45:42 mokhov Exp $
Field Summary | |
---|---|
protected double |
dImaginary
|
protected double |
dReal
|
Constructor Summary | |
---|---|
ComplexNumber()
|
|
ComplexNumber(ComplexNumber poNumber)
Copy-constructor. |
|
ComplexNumber(double pdReal)
|
|
ComplexNumber(double pdReal,
double pdImaginary)
|
Method Summary | |
---|---|
double |
abs()
abs(this) = |this|. |
static double |
abs(ComplexNumber poNumber)
Magnitude = abs(z) = |z|. |
ComplexNumber |
add(ComplexNumber poNumber2)
this = this + C. |
static ComplexNumber |
add(ComplexNumber poNumber1,
ComplexNumber poNumber2)
C3 = C1 + C2. |
double |
arg()
|
static double |
arg(ComplexNumber poNumber)
|
ComplexNumber |
divide(ComplexNumber poNumber2)
this = this / C. |
static ComplexNumber |
divide(ComplexNumber poNumber1,
ComplexNumber poNumber2)
C3 = C1 / C2. |
boolean |
equals(java.lang.Object poNumber)
Two complex numbers are equal if and only if their real parts are equal and their imaginary parts are equal. |
double |
getImaginary()
Allows querying for TODO. |
double |
getPhaseAngle()
|
double |
getRadius()
|
double |
getReal()
Allows querying for TODO. |
int |
hashCode()
|
ComplexNumber |
multiply(ComplexNumber poNumber2)
this = this * C. |
static ComplexNumber |
multiply(ComplexNumber poNumber1,
ComplexNumber poNumber2)
C3 = C1 * C2. |
static ComplexNumber |
pow(ComplexNumber poNumber,
double pdPower)
z1 = z ^ n. |
ComplexNumber |
pow(double pdPower)
this = this ^ n. |
ComplexNumber |
set(ComplexNumber poNumber)
this = C. |
void |
setImaginary(double pdImaginary)
Allows setting TODO. |
void |
setPhaseAngle(double pdPhaseAngle)
Sets real and imaginary parts given the phase angle in the polar coordinates. |
void |
setPolarCoordinates(double pdPhaseAngle,
double pdRadius)
|
void |
setReal(double pdReal)
Allows setting TODO. |
ComplexNumber |
subtract(ComplexNumber poNumber2)
this = this - C. |
static ComplexNumber |
subtract(ComplexNumber poNumber1,
ComplexNumber poNumber2)
C3 = C1 - C2. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected double dReal
protected double dImaginary
Constructor Detail |
---|
public ComplexNumber()
public ComplexNumber(double pdReal, double pdImaginary)
pdReal
- pdImaginary
- public ComplexNumber(double pdReal)
pdReal
- public ComplexNumber(ComplexNumber poNumber)
poNumber
- the complex number to copyMethod Detail |
---|
public static ComplexNumber add(ComplexNumber poNumber1, ComplexNumber poNumber2)
poNumber1
- C1poNumber2
- C2
public ComplexNumber add(ComplexNumber poNumber2)
poNumber2
- C
public static ComplexNumber subtract(ComplexNumber poNumber1, ComplexNumber poNumber2)
poNumber1
- C1poNumber2
- C2
public ComplexNumber subtract(ComplexNumber poNumber2)
poNumber2
- C
public static ComplexNumber multiply(ComplexNumber poNumber1, ComplexNumber poNumber2)
poNumber1
- C1poNumber2
- C2
public ComplexNumber multiply(ComplexNumber poNumber2)
poNumber2
- C
public static ComplexNumber divide(ComplexNumber poNumber1, ComplexNumber poNumber2)
poNumber1
- C1poNumber2
- C2
public ComplexNumber divide(ComplexNumber poNumber2)
poNumber2
- C
public static double abs(ComplexNumber poNumber)
poNumber
- z
public double abs()
public static double arg(ComplexNumber poNumber)
poNumber
-
public double arg()
public static ComplexNumber pow(ComplexNumber poNumber, double pdPower)
poNumber
- zpdPower
- n
public ComplexNumber pow(double pdPower)
pdPower
- n
public ComplexNumber set(ComplexNumber poNumber)
poNumber
- C
public double getImaginary()
public void setImaginary(double pdImaginary)
pdImaginary
- the new value of dImaginary to set.public double getReal()
public void setReal(double pdReal)
pdReal
- the new value of dReal to set.public void setPhaseAngle(double pdPhaseAngle)
pdPhaseAngle
- the phase angle to usepublic void setPolarCoordinates(double pdPhaseAngle, double pdRadius)
pdPhaseAngle
- pdRadius
- public double getPhaseAngle()
public double getRadius()
public boolean equals(java.lang.Object poNumber)
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |