|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object JSci.maths.Complex
public final class Complex
The Complex class encapsulates complex numbers.
Field Summary | |
---|---|
static Complex |
I
The complex number 0+1i. |
static Complex |
ONE
The complex number 1+0i. |
static Complex |
ZERO
The complex number 0+0i. |
Constructor Summary | |
---|---|
Complex(double x,
double y)
Constructs the complex number x+iy. |
|
Complex(java.lang.String s)
Constructs the complex number represented by a string. |
Method Summary | |
---|---|
static Complex |
acos(Complex z)
Returns the arc cosine of a complex number, in the range of (0.0 through , 0.0 through ). |
static Complex |
acosh(Complex z)
Returns the arc hyperbolic cosine of a complex number, in the range of (0.0 through , 0.0 through ). |
AbelianGroup.Member |
add(AbelianGroup.Member x)
Returns the addition of this number and another. |
Complex |
add(Complex z)
Returns the addition of this complex number and another. |
Complex |
addImag(double imag)
Returns the addition of this complex number with an imaginary part. |
Complex |
addReal(double real)
Returns the addition of this complex number with a real part. |
double |
arg()
Returns the argument of this complex number. |
static Complex |
asin(Complex z)
Returns the arc sine of a complex number, in the range of (-/2 through /2, - through ). |
static Complex |
asinh(Complex z)
Returns the arc hyperbolic sine of a complex number, in the range of (- through , -/2 through /2). |
static Complex |
atan(Complex z)
Returns the arc tangent of a complex number, in the range of (-/2 through /2, - through ). |
static Complex |
atanh(Complex z)
Returns the arc hyperbolic tangent of a complex number, in the range of (- through , -/2 through /2). |
Complex |
conjugate()
Returns the complex conjugate of this complex number. |
static Complex |
cos(Complex z)
Returns the trigonometric cosine of a complex angle. |
static Complex |
cosh(Complex z)
Returns the hyperbolic cosine of a complex number. |
Complex |
divide(Complex z)
Returns the division of this complex number by another. |
Complex |
divide(double x)
Returns the division of this complex number by a scalar. |
Field.Member |
divide(Field.Member x)
Returns the division of this number and another. |
boolean |
equals(double real,
double imag)
Compares two complex numbers for equality. |
boolean |
equals(double real,
double imag,
double tol)
|
boolean |
equals(java.lang.Object obj)
Compares two complex numbers for equality. |
boolean |
equals(java.lang.Object obj,
double tol)
|
static Complex |
exp(Complex z)
Returns the exponential number e (2.718...) raised to the power of a complex number. |
java.lang.Object |
getSet()
|
int |
hashCode()
Returns a hashcode for this complex number. |
double |
imag()
Returns the imaginary part of this complex number. |
Field.Member |
inverse()
Returns the inverse of this complex number. |
CStarAlgebra.Member |
involution()
Returns the involution of this complex number. |
boolean |
isInfinite()
Returns true if either the real or imaginary part is infinite. |
boolean |
isNaN()
Returns true if either the real or imaginary part is NaN. |
boolean |
isZero()
Returns true if the modulus of this complex number is within the zero tolerance. |
static Complex |
log(Complex z)
Returns the natural logarithm (base e) of a complex number. |
double |
mod()
Returns the modulus of this complex number. |
double |
modSqr()
Returns the square of the modulus of this complex number. |
Complex |
multiply(Complex z)
Returns the multiplication of this complex number and another. |
Complex |
multiply(double x)
Returns the multiplication of this complex number by a scalar. |
Ring.Member |
multiply(Ring.Member x)
Returns the multiplication of this number and another. |
AbelianGroup.Member |
negate()
Returns the negative of this complex number. |
double |
norm()
Returns the C* norm. |
static Complex |
polar(double mod,
double arg)
Creates a complex number with the given modulus and argument. |
Complex |
pow(Complex z)
Returns this complex number raised to the power of another. |
Complex |
pow(double x)
Returns this complex number raised to the power of a scalar. |
double |
real()
Returns the real part of this complex number. |
VectorSpace.Member |
scalarDivide(Field.Member x)
Returns the division of this number by a complex scalar. |
Module.Member |
scalarMultiply(Ring.Member x)
Returns the multiplication of this number by a complex scalar. |
static Complex |
sin(Complex z)
Returns the trigonometric sine of a complex angle. |
static Complex |
sinh(Complex z)
Returns the hyperbolic sine of a complex number. |
Complex |
sqr()
Returns the square of this complex number. |
Complex |
sqrt()
Returns the square root of this complex number. |
AbelianGroup.Member |
subtract(AbelianGroup.Member x)
Returns the subtraction of this number and another. |
Complex |
subtract(Complex z)
Returns the subtraction of this complex number by another. |
Complex |
subtractImag(double imag)
Returns the subtraction of this complex number by an imaginary part. |
Complex |
subtractReal(double real)
Returns the subtraction of this complex number by a real part. |
static Complex |
tan(Complex z)
Returns the trigonometric tangent of a complex angle. |
static Complex |
tanh(Complex z)
Returns the hyperbolic tangent of a complex number. |
java.lang.String |
toString()
Returns a string representing the value of this complex number. |
static java.lang.String |
toString(double real,
double imag)
Returns a string representing the value of this complex number. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Complex I
public static final Complex ONE
public static final Complex ZERO
Constructor Detail |
---|
public Complex(double x, double y)
x
- the real value of a complex number.y
- the imaginary value of a complex number.public Complex(java.lang.String s) throws java.lang.NumberFormatException
s
- a string representing a complex number.
java.lang.NumberFormatException
- if the string does not contain a parsable number.Method Detail |
---|
public static Complex polar(double mod, double arg)
mod
- the modulus of a complex number.arg
- the argument of a complex number.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- a complex number.public boolean equals(java.lang.Object obj, double tol)
public boolean equals(double real, double imag)
public boolean equals(double real, double imag, double tol)
public java.lang.String toString()
toString
in class java.lang.Object
public static java.lang.String toString(double real, double imag)
public int hashCode()
hashCode
in class java.lang.Object
public boolean isZero()
public boolean isNaN()
public boolean isInfinite()
public double real()
public double imag()
public double mod()
public double modSqr()
public double arg()
public double norm()
norm
in interface BanachSpace.Member
public java.lang.Object getSet()
getSet
in interface Member
public AbelianGroup.Member negate()
negate
in interface AbelianGroup.Member
public Field.Member inverse()
inverse
in interface Field.Member
public CStarAlgebra.Member involution()
involution
in interface CStarAlgebra.Member
public Complex conjugate()
public AbelianGroup.Member add(AbelianGroup.Member x)
add
in interface AbelianGroup.Member
x
- a group memberpublic Complex add(Complex z)
z
- a complex number.public Complex addReal(double real)
real
- a real part.public Complex addImag(double imag)
imag
- an imaginary part.public AbelianGroup.Member subtract(AbelianGroup.Member x)
subtract
in interface AbelianGroup.Member
x
- a group memberpublic Complex subtract(Complex z)
z
- a complex number.public Complex subtractReal(double real)
real
- a real part.public Complex subtractImag(double imag)
imag
- an imaginary part.public Module.Member scalarMultiply(Ring.Member x)
scalarMultiply
in interface Module.Member
x
- a ring memberpublic Ring.Member multiply(Ring.Member x)
multiply
in interface Ring.Member
x
- a ring memberpublic Complex multiply(Complex z)
z
- a complex number.public Complex multiply(double x)
x
- a real number.public VectorSpace.Member scalarDivide(Field.Member x)
scalarDivide
in interface VectorSpace.Member
x
- a field memberpublic Field.Member divide(Field.Member x)
divide
in interface Field.Member
x
- a field memberpublic Complex divide(Complex z)
z
- a complex number.
java.lang.ArithmeticException
- If divide by zero.public Complex divide(double x)
x
- a real number.
java.lang.ArithmeticException
- If divide by zero.public Complex pow(Complex z)
z
- a complex number.public Complex pow(double x)
x
- a real number.public Complex sqr()
public Complex sqrt()
public static Complex exp(Complex z)
z
- a complex number.public static Complex log(Complex z)
z
- a complex number.public static Complex sin(Complex z)
z
- an angle that is measured in radians.public static Complex cos(Complex z)
z
- an angle that is measured in radians.public static Complex tan(Complex z)
z
- an angle that is measured in radians.public static Complex sinh(Complex z)
z
- a complex number.public static Complex cosh(Complex z)
z
- a complex number.public static Complex tanh(Complex z)
z
- a complex number.public static Complex asin(Complex z)
z
- a complex number.public static Complex acos(Complex z)
z
- a complex number.public static Complex atan(Complex z)
z
- a complex number.public static Complex asinh(Complex z)
z
- a complex number.public static Complex acosh(Complex z)
z
- a complex number.public static Complex atanh(Complex z)
z
- a complex number.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |