|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Number
org.rubato.math.arith.Complex
public final class Complex
Complex number arithmetic.
Constructor Summary | |
---|---|
Complex()
Creates the complex number 0+i0. |
|
Complex(Complex c)
Creates a new complex number from c . |
|
Complex(double real)
Creates the complex number real+i0. |
|
Complex(double real,
double imag)
Creates the complex number real+i*imag. |
|
Complex(int real)
Creates the complex number real+i0. |
|
Complex(java.lang.String s)
Creates a new complex number from its string representation. |
Method Summary | |
---|---|
double |
abs()
Returns the absolute value of this number. |
Complex |
acos()
Returns the arccosine of this number. |
void |
add(Complex c)
Adds the complex number c to this number. |
void |
add(double x)
Adds the real number x to this number. |
double |
arg()
Returns the argument of this number. |
Complex |
asin()
Returns the arcsine of this number. |
Complex |
atan(Complex c)
Returns the arctangent of this number and c . |
java.lang.Object |
clone()
|
int |
compareTo(Complex c)
Compares this number with object . |
void |
conjugate()
Conjugates this number. |
Complex |
conjugated()
Returns the conjugate of this number. |
Complex |
cos()
Returns the cosine of this number. |
Complex |
difference(Complex c)
Returns the difference of this number and c . |
Complex |
difference(double x)
Returns the difference of this number and x . |
void |
divide(Complex c)
Divides this number by c . |
void |
divide(double x)
Divides this number by x . |
double |
doubleValue()
Returns the real part of the complex number as a double. |
Complex |
exp()
Returns the exponential of this number. |
Complex |
expt(Complex c)
Returns this number raised to the power c . |
float |
floatValue()
Returns the real part of the complex number as a float. |
static Complex |
fromPolar(double r,
double phi)
Creates a complex number with the polar representation r*e^(i*phi). |
double |
getImag()
Returns the imaginary part of this number. |
static Complex |
getOne()
Returns the complex number 1+i0. |
double |
getReal()
Returns the real part of this number. |
static Complex |
getZero()
Returns the complex number 0+i0. |
int |
hashCode()
Returns hashcode for this number. |
int |
intValue()
Returns the real part of the complex number rounded to an integer. |
Complex |
inverse()
Returns the inverse of this number. |
void |
invert()
Inverts this number. |
boolean |
isOne()
Returns true iff this number is 1+i0. |
boolean |
isReal()
Returns true iff the imaginary part is zero. |
boolean |
isZero()
Returns true iff this number is 0+i0. |
Complex |
log()
Returns the natural logarithm of this number. |
long |
longValue()
Returns the real part of the complex number rounded to a long. |
void |
multiply(Complex c)
Multiplies this number with c . |
void |
negate()
Negates this number. |
Complex |
negated()
Returns the negative of this number. |
static Complex |
parseComplex(java.lang.String s)
Returns the complex number with the string representation s |
Complex |
product(Complex c)
Returns the product of this number and c . |
Complex |
product(double x)
Returns the product of this number and the real number x . |
Complex |
quotient(Complex c)
Returns the quotient of this number by c . |
Complex |
quotient(double x)
Returns the quotient of this number by x . |
Complex |
sin()
Returns the sine of this number. |
Complex |
sqrt()
Returns the square root of this number. |
void |
subtract(Complex c)
Subtracts the complex number c from this number. |
Complex |
sum(Complex c)
Returns the sum of this number and c . |
Complex |
sum(double x)
Returns the sum of this number and x . |
Complex |
tan()
Returns the tangent of this number. |
java.lang.String |
toString()
Returns the string representation of this number. |
Methods inherited from class java.lang.Number |
---|
byteValue, shortValue |
Methods inherited from class java.lang.Object |
---|
equals, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Complex()
public Complex(double real, double imag)
public Complex(double real)
public Complex(int real)
public Complex(Complex c)
c
.
public Complex(java.lang.String s)
s
- must be of the form "x+i*y" where x and y are
string representations of doubles,
or of one of the forms "i*x" or "i"Method Detail |
---|
public static Complex fromPolar(double r, double phi)
r
- the absolute value of the complex numberphi
- the argument of the complex numberpublic int intValue()
intValue
in class java.lang.Number
public long longValue()
longValue
in class java.lang.Number
public float floatValue()
floatValue
in class java.lang.Number
public double doubleValue()
doubleValue
in class java.lang.Number
public static Complex getOne()
public static Complex getZero()
public Complex sum(Complex c)
c
.
public Complex sum(double x)
x
.
public void add(Complex c)
c
to this number.
public void add(double x)
x
to this number.
public Complex difference(Complex c)
c
.
public Complex difference(double x)
x
.
public void subtract(Complex c)
c
from this number.
public Complex product(Complex c)
c
.
public Complex product(double x)
x
.
public void multiply(Complex c)
c
.
public Complex quotient(Complex c)
c
.
public Complex quotient(double x)
x
.
public void divide(Complex c)
c
.
public void divide(double x)
x
.
public Complex inverse()
public void invert()
public Complex negated()
public void negate()
public Complex conjugated()
public void conjugate()
public boolean isZero()
public boolean isOne()
public double getReal()
public double getImag()
public boolean isReal()
public double abs()
public double arg()
public Complex sqrt()
public Complex log()
public Complex exp()
public Complex expt(Complex c)
c
.
public Complex sin()
public Complex cos()
public Complex tan()
public Complex asin()
public Complex acos()
public Complex atan(Complex c)
c
.
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public static Complex parseComplex(java.lang.String s)
s
public java.lang.Object clone()
clone
in class java.lang.Object
public int compareTo(Complex c)
object
.
Since complex numbers are not linearly ordered, the comparison
is lexicographic.
compareTo
in interface java.lang.Comparable<Complex>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |