|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.math.complex.Complex
Representation of a Complex number - a number which has both a real and imaginary part.
Field Summary | |
static Complex |
I
The square root of -1. |
protected double |
imaginary
The imaginary part. |
static Complex |
NaN
A complex number representing "(Double.NaN) + (Double.NaN)i" |
static Complex |
ONE
A complex number representing "1.0 + 0.0i" |
protected double |
real
The real part. |
(package private) static long |
serialVersionUID
Serializable version identifier |
Constructor Summary | |
Complex(double real,
double imaginary)
Create a complex number given the real and imaginary parts. |
Method Summary | |
double |
abs()
Return the absolute value of this complex number. |
Complex |
add(Complex rhs)
Return the sum of this complex number and the given complex number. |
Complex |
conjugate()
Return the conjugate of this complex number. |
Complex |
divide(Complex rhs)
Return the quotient of this complex number and the given complex number. |
boolean |
equals(Object other)
Test for the equality of two Complex objects. |
double |
getImaginary()
Access the imaginary part. |
double |
getReal()
Access the real part. |
boolean |
isNaN()
Returns true if this complex number is the special Not-a-Number (NaN) value. |
Complex |
multiply(Complex rhs)
Return the product of this complex number and the given complex number. |
Complex |
negate()
Return the additive inverse of this complex number. |
Complex |
subtract(Complex rhs)
Return the difference between this complex number and the given complex number. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
static final long serialVersionUID
public static final Complex I
public static final Complex NaN
public static final Complex ONE
protected double imaginary
protected double real
Constructor Detail |
public Complex(double real, double imaginary)
real
- the real part.imaginary
- the imaginary part.Method Detail |
public double abs()
public Complex add(Complex rhs)
rhs
- the other complex number.
public Complex conjugate()
public Complex divide(Complex rhs)
rhs
- the other complex number.
public boolean equals(Object other)
other
- Object to test for equality to this
public double getImaginary()
public double getReal()
public boolean isNaN()
public Complex multiply(Complex rhs)
rhs
- the other complex number.
public Complex negate()
public Complex subtract(Complex rhs)
rhs
- the other complex number.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |