|
JScience v3.3 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavolution.context.RealtimeObject
org.jscience.mathematics.numbers.Number<Complex>
org.jscience.mathematics.numbers.Complex
public final class Complex
This class represents an immutable complex number.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javolution.context.RealtimeObject |
|---|
RealtimeObject.Factory<T extends RealtimeObject> |
| Nested classes/interfaces inherited from interface javolution.context.Realtime |
|---|
Realtime.ObjectSpace |
| Field Summary | |
|---|---|
static LocalContext.Reference<TextFormat<Complex>> |
FORMAT
Holds the local text format for complex numbers (cartesian form by default, e.g. "2.34 - 0.4i"). |
static Complex |
I
The imaginary unit i. |
static Complex |
ONE
The complex number one. |
protected static XMLFormat<Complex> |
XML
Holds the default XML representation for complex numbers. |
static Complex |
ZERO
The complex number zero. |
| Method Summary | |
|---|---|
double |
argument()
Returns the argument of this complex number. |
int |
compareTo(Complex that)
Compares two complex numbers, the real components are compared first, then if equal, the imaginary components. |
Complex |
conjugate()
Returns the conjugate of this complex number. |
Complex |
divide(Complex that)
Returns this complex divided by the specified complex. |
Complex |
divide(double k)
Returns this complex divided by the specified factor. |
double |
doubleValue()
Returns the real component of this Complex
number as a double. |
boolean |
equals(Complex that,
double tolerance)
Indicates if two complexes are "sufficiently" alike to be considered equal. |
boolean |
equals(java.lang.Object that)
Compares this complex against the specified Object. |
Complex |
exp()
Returns the exponential number e raised to the power of this complex. |
double |
getImaginary()
Returns the imaginary component of this complex number. |
double |
getReal()
Returns the real component of this complex number. |
int |
hashCode()
Returns the hash code for this complex number. |
Complex |
inverse()
Returns the inverse of this complex. |
boolean |
isInfinite()
Indicates if either the real or imaginary component of this complex is infinite. |
boolean |
isLargerThan(Complex that)
Compares the magnitude of this complex number
with the magnitude of the complex number specified. |
boolean |
isNaN()
Indicates if either the real or imaginary component of this complex is not a number. |
Complex |
log()
Returns the principal natural logarithm (base e) of this complex. |
long |
longValue()
Returns the real component of this Complex
number as a long. |
double |
magnitude()
Returns the magnitude of this complex number, also referred to as the "modulus" or "length". |
Complex |
minus(Complex that)
Returns the difference between this complex and the one specified. |
Complex |
opposite()
Returns the negation of this complex. |
Complex |
plus(Complex that)
Returns the sum of this complex with the one specified. |
Complex |
pow(Complex that)
Returns this complex raised to the power of the specified complex exponent. |
Complex |
pow(double e)
Returns this complex raised to the specified power. |
Complex |
sqrt()
Returns one of the two square root of this complex number. |
Complex |
times(Complex that)
Returns the product of this complex with the one specified. |
Complex |
times(double k)
Returns this complex multiplied by the specified factor. |
Text |
toText()
Returns the text representation of this complex number. |
static Complex |
valueOf(java.lang.CharSequence csq)
Returns the complex number for the specified character sequence. |
static Complex |
valueOf(double real,
double imaginary)
Returns the complex number having the specified real and imaginary components. |
| Methods inherited from class org.jscience.mathematics.numbers.Number |
|---|
byteValue, floatValue, intValue, isGreaterThan, isLessThan, move, pow, shortValue |
| Methods inherited from class javolution.context.RealtimeObject |
|---|
export, isLocal, moveHeap, preserve, toString, unpreserve |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface javolution.context.Realtime |
|---|
move |
| Field Detail |
|---|
public static final LocalContext.Reference<TextFormat<Complex>> FORMAT
"2.34 - 0.4i").
protected static final XMLFormat<Complex> XML
real and
imaginary attributes (e.g.
<Complex real="2.34" imaginary="-0.4"/>).
public static final Complex ZERO
public static final Complex ONE
public static final Complex I
| Method Detail |
|---|
public static Complex valueOf(double real,
double imaginary)
real - the real component of this complex number.imaginary - the imaginary component of this complex number.
getReal(),
getImaginary()public static Complex valueOf(java.lang.CharSequence csq)
csq - the character sequence.
Complex.FORMAT.get().parse(csq)
java.lang.IllegalArgumentException - if the character sequence does not
contain a parsable complex number.FORMATpublic boolean isInfinite()
true if this complex is infinite;
false otherwise.public boolean isNaN()
true if this complex is NaN;
false otherwise.public double getReal()
public double getImaginary()
public Complex opposite()
opposite in interface GroupAdditive<Complex>-this.public Complex plus(Complex that)
plus in interface GroupAdditive<Complex>that - the complex to be added.
this + that.public Complex minus(Complex that)
minus in class Number<Complex>that - the complex to be subtracted.
this - that.public Complex times(double k)
k - the factor multiplier.
this * k.public Complex times(Complex that)
times in interface GroupMultiplicative<Complex>times in interface Ring<Complex>that - the complex multiplier.
this * that.public Complex inverse()
inverse in interface GroupMultiplicative<Complex>1 / this.public Complex divide(double k)
k - the factor divisor.
this / k.public Complex divide(Complex that)
that - the complex divisor.
this / that.public Complex conjugate()
(this.real(), - this.imaginary()).public double magnitude()
public double argument()
public Complex sqrt()
sqrt(this).public Complex exp()
ePI*i
= -1
exp(this).public Complex log()
log(this).public Complex pow(double e)
e - the exponent.
this**e.public Complex pow(Complex that)
that - the exponent.
this**that.
public boolean equals(Complex that,
double tolerance)
that - the complex to compare with.tolerance - the maximum magnitude of the difference between
them before they are considered not equal.
true if they are considered equal;
false otherwise.public boolean equals(java.lang.Object that)
equals in class Number<Complex>that - the object to compare with.
true if the objects are the same;
false otherwise.public int hashCode()
hashCode in class Number<Complex>public Text toText()
toText in interface RealtimetoText in class Number<Complex>Complex.FORMAT.get().format(this)FORMATpublic long longValue()
real component of this Complex
number as a long.
longValue in class Number<Complex>(long) this.getReal()public double doubleValue()
real component of this Complex
number as a double.
doubleValue in class Number<Complex>(double) this.getReal()public int compareTo(Complex that)
compareTo in interface java.lang.Comparable<Complex>compareTo in class Number<Complex>that - the complex number to be compared with.
public boolean isLargerThan(Complex that)
magnitude of this complex number
with the magnitude of the complex number specified.
isLargerThan in class Number<Complex>that - the complex number to be compared with.
|this| > |that|
|
JScience v3.3 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||