java.lang.Objectnet.sourceforge.javacomplex.Complex
JavaComplex is a complex number library for Java.
|
Project Downloads |
| Field Summary | |
static Complex |
E
The Complex value closest to e, the base of the natural logarithms. |
static Complex |
I
The Complex value for i, the imaginary unit. |
static Complex |
INFINITY
The Complex value for ∞, the point at infinity. |
static Complex |
NaN
The Complex not-a-number. |
static Complex |
ONE
The Complex value for 1, the multiplicative identity. |
static Complex |
PI
The Complex value closest to π, the ratio of a circle's circumference to its diameter. |
static Complex |
ZERO
The Complex value for 0, the additive identity. |
| Constructor Summary | |
Complex()
|
|
| Method Summary | |
abstract double |
abs()
Returns the absolute value of this Complex value. |
Complex |
add(Complex z)
Returns the addition of a given Complex with this Complex value. |
abstract double |
arg()
Returns the argument of this Complex value. |
static Complex |
arg(double arg)
Creates a Complex value from its argument. |
static Complex |
cart(double real,
double imag)
Creates a Complex value from its real and imaginary parts. |
abstract Complex |
conj()
Returns the conjugate of this Complex value. |
abstract double |
decl()
Returns the declination of this Complex value. |
Complex |
div(Complex z)
Returns the division by a given Complex of this Complex value. |
boolean |
equals(java.lang.Object o)
Indicates wheather a given Object is equal to this Complex value. |
int |
hashCode()
Returns a hash code value for this Complex value. |
abstract double |
imag()
Returns the imaginary part of this Complex value. |
static Complex |
imag(double imag)
Creates a Complex value from its imaginary part. |
abstract Complex |
inv()
Returns the inverse of this Complex value. |
boolean |
isInfinite()
Checks whether this Complex value is infinite. |
boolean |
isNaN()
Checks whether this Complex value is not-a-number. |
Complex |
mul(Complex z)
Returns the multiplication of a given Complex with this Complex value. |
abstract Complex |
neg()
Returns the negation of this Complex value. |
abstract Complex |
opp()
Returns the oposite of this Complex value. |
static Complex |
polar(double abs,
double arg)
Creates a Complex value from its absolute value and argument. |
abstract double |
real()
Returns the real part of this Complex value. |
static Complex |
real(double real)
Creates a Complex value from its real part. |
static Complex |
riemann(double arg,
double decl)
Creates a Complex value from its argument and declination. |
Complex |
scale(double x)
Returns this Complex value scaled by a given double number. |
Complex |
sqr()
Returns the square of this Complex value. |
Complex |
sqrt()
Returns the principal squareroot of this Complex value. |
Complex |
sub(Complex z)
Returns the subtraction of a given Complex from this Complex value. |
| Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final Complex ZERO
Complex value for 0, the additive identity.
public static final Complex ONE
Complex value for 1, the multiplicative identity.
public static final Complex I
Complex value for i, the imaginary unit.
public static final Complex E
Complex value closest to e, the base of the natural logarithms.
public static final Complex PI
Complex value closest to π, the ratio of a circle's circumference to its diameter.
public static final Complex NaN
Complex not-a-number.
public static final Complex INFINITY
Complex value for ∞, the point at infinity.
| Constructor Detail |
public Complex()
| Method Detail |
public static final Complex real(double real)
Complex value from its real part.
Factory method that creates a Complex object from its real part.
Special cases:
real - the real part
Complex of real part real and imaginary part 0public static final Complex imag(double imag)
Complex value from its imaginary part.
Factory method that creates a Complex object from its imaginary part.
Special cases:
imag - the imaginary part
Complex of imaginary part imag and real part 0public static final Complex arg(double arg)
Complex value from its argument.
Factory method that creates a Complex object from its argument.
arg - the argument
Complex of and argument arg absolute value 1
public static final Complex cart(double real,
double imag)
Complex value from its real and imaginary parts.
Factory method that creates a Complex object from its real and imaginary parts.
Special cases:
real - the real partimag - the imaginary part
Complex of real part real and imaginary part imag
public static final Complex polar(double abs,
double arg)
Complex value from its absolute value and argument.
Factory method that creates a Complex object from its absolute value and argument.
Special cases:
abs - theabsolute valuearg - the argument
Complex of absolute value abs and argument arg
public static final Complex riemann(double arg,
double decl)
Complex value from its argument and declination.
Factory method that creates a Complex object from argument and declination.
Special cases:
arg - the argumentdecl - the declination
Complex with argument arg and declination decldecl()public final boolean isNaN()
Complex value is not-a-number.
public final boolean isInfinite()
Complex value is infinite.
public abstract double real()
Complex value.
Special cases:
Complex is nan, nan is returned;Complex is infinite, positive infinity is returned;
public abstract double imag()
Complex value.
Special cases:
Complex is nan, nan is returned;Complex is infinite, 0 is returned;
public abstract double abs()
Complex value.
Special cases:
Complex is nan, nan is returned;Complex is infinite, positive infinity is returned;
public abstract double arg()
Complex value.
Special cases:
Complex is nan, nan is returned;Complex is infinite, 0 is returned;
public abstract double decl()
Complex value.
The declination is the angular distance mesured north from the south pole of Riemann's sphere. Also, note that
this value belongs to [0+2kπ, π+2kπ] for some integer k.
Special cases:
Complex is nan, nan is returned;Complex is infinite, the double value closest to pi is returned;
public abstract Complex conj()
Complex value.
Special cases:
Complex is nan, nan is returned;Complex is infinite, infinity is returned;
public abstract Complex neg()
Complex value.
Special cases:
Complex is nan, nan is returned;Complex is infinite, infinity is returned;
public abstract Complex inv()
Complex value.
Special cases:
Complex is nan, nan is returned;Complex is zero, infinity is returned;Complex is infinite, zero is returned;
public abstract Complex opp()
Complex value.
The opposite of a Complex value is the value that oposes it in the Riemann sphere representation of
complex numbers.
Special cases:
Complex is nan, nan is returned;Complex is zero, infinity is returned;Complex is infinite, zero is returned;
public final boolean equals(java.lang.Object o)
Object is equal to this Complex value.
Complex objects are equal if and only if their real and imaginary parts are equal.
o - the reference object with which to compare
Complex value is the same as o, false otherwisepublic final int hashCode()
Complex value.
If two Complex values are equal according to the equals(Object) method, then calling
the hashCode() method on each of those Complex values produces the same integer result.
Complex valueequals(Object)public Complex add(Complex z)
Complex with this Complex value.
Special cases:
Complex is nan, nan is returned;Complex values are infinite, nan is returned;Complex is infinite and the other is finite, infinity is returned;
public Complex sub(Complex z)
Complex from this Complex value.
Special cases:
Complex is nan, nan is returned;Complex values are infinite, nan is returned;Complex is infinite and the other is finite, infinity is returned;
public Complex mul(Complex z)
Complex with this Complex value.
Special cases:
Complex is nan, nan is returned;Complex is infinite and neither is nan nor zero, infinity is returned;Complex is infinite and the other is zero, nan is returned;
public Complex div(Complex z)
Complex of this Complex value.
Special cases:
Complex is nan, nan is returned;Complex is infinite and the other is finite, infinity is returned;Complex is finite and the other is infinite, zero is returned;Complex is neither nan nor zero and the other is zero, infinity is returned;Complex values are infinite, nan is returned;Complex values are zero nan is returned;
public Complex scale(double x)
Complex value scaled by a given double number.
Special cases:
Complex or the double is nan, nan is returned;Complex or the double is infinite and neither is nan nor zero, infinity is returned;Complex is infinite and the double is zero, nan is returned;Complex is zero and the double is infinite, nan is returned;
public Complex sqr()
Complex value.
Special cases:
Complex is nan, nan is returned;Complex is infinite, infinity is returned;
public Complex sqrt()
Complex value.
Special cases:
Complex is nan, nan is returned;Complex is infinite, infinity is returned;