|
JIGL v1.6 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--java.lang.Number
|
+--jigl.math.Complex
Complex Number Operations. For desciptions of these operations, see Complex Functions.
| Field Summary | |
protected float |
x
the real part of the Complex number |
protected float |
y
imaginary part of the Complex number |
| Fields inherited from class java.lang.Number |
|
| Constructor Summary | |
Complex()
Sets the real and imaginary part of the complex number to zero |
|
Complex(Complex z)
Initilizes the complex number to z |
|
Complex(double a,
double b)
Initilizes the real and imaginary part to a and b repectively |
|
| Method Summary | |
Complex |
add(Complex z)
Adds this complex number to another complex number. |
static Complex |
add(Complex z1,
Complex z2)
Adds two complex numbers |
Complex |
add(double a)
Adds a constant to the real part of this complex number. |
double |
arg()
Returns the phase of the complex number.Converts rectangular coordinates (x, y) to polar (r, theta). |
Complex |
conj()
Performs the conjuction function on the complex number |
Complex |
cos()
Returns the cosine of this complex number. |
Complex |
cosh()
Returns the hyperbolic cosine of this complex number. |
Complex |
div(Complex z)
Divides this complex number by z (z shouldn't be 0 |
static Complex |
div(Complex z1,
Complex z2)
Divides two complex numbers |
Complex |
div(double a)
Divides this complex number by a constant a(a shouldn't be 0). |
double |
doubleValue()
Returns the double value of this complex number |
boolean |
equals(Complex z)
Compares this complex number to another Complex number |
Complex |
exp()
Returns the result of e^(x+y*i) = e^x * e^(i*y) = e^x*(cos(y) + sin(y)). |
float |
floatValue()
Returns the float value of this complex number |
double |
imag()
Return the imaginary part of the imaginary number |
double |
imag(double a)
Sets the imaginary part of the complex number and returns old value |
int |
intValue()
Returns the integer value of this complex number |
(package private) Complex |
j1mult()
Returns a complex number with the negative of this complex number's real part |
(package private) Complex |
j2mult()
Returns a complex number with the negative of this complex number's real and imaginary part |
(package private) Complex |
j3mult()
Returns a complex number with the negative of this complex number's imaginary part |
Complex |
log()
Returns the result of ln(x+y*i) = ln(r*e^(i*theta)) = ln(r) + i*theta. |
long |
longValue()
Returns the long value of this complex number |
double |
magnitude()
Returns the magnitude of the complex number |
Complex |
mult(Complex z)
Multiplies this complex number by another complex number. |
static Complex |
mult(Complex z1,
Complex z2)
Multiplies two complex numbers |
Complex |
mult(double a)
Multiplies this complex number by a constant. |
void |
polar(double r,
double t)
Converts polarrectangular coordinates (r,t) to rectangular (x, y). |
Complex |
pow(double a)
Returns this complex number raised to the power a complex number. |
double |
real()
Returns the real part of the complex number |
double |
real(double a)
Set the real part of the complex number and returns old value |
Complex |
sin()
Returns the sine of this complex number sin(x+y*i) = sin(x)*cosh(y), i*(cos(x)*sinh(y)) |
Complex |
sinh()
Returns the hyperbolic sine of this complex number. |
Complex |
sqrt()
Returns the square root of this complex number |
Complex |
sub(Complex z)
Subtracts another complex number from this complex number. |
static Complex |
sub(Complex z1,
Complex z2)
Subtracts two complex numbers |
Complex |
sub(double a)
Subtracts a constant from the real part of this complex number. |
String |
toString()
Return the string representation of this complex number |
Complex |
unit()
Normalizes the complex number |
| Methods inherited from class java.lang.Number |
byteValue, shortValue |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected float x
protected float y
| Constructor Detail |
public Complex()
public Complex(double a,
double b)
a - Real part of the complex numberb - the imaginary part of the complex numberpublic Complex(Complex z)
| Method Detail |
public double real()
public double real(double a)
public double imag()
public double imag(double a)
public double magnitude()
public double arg()
public Complex unit()
public Complex conj()
public void polar(double r,
double t)
public boolean equals(Complex z)
public String toString()
toString in class Objectpublic Complex add(Complex z)
this
is modified.
z - Complex number to addpublic Complex sub(Complex z)
this
is modified.
z - Complex number to subtractpublic Complex mult(Complex z)
this
is modified.
z - Complex number to multiplypublic Complex div(Complex z)
z (z shouldn't be 0). this
is modified.
- Parameters:
z - Complex number to divide
public Complex add(double a)
this
is modified.
a - constant to addpublic Complex sub(double a)
this
is modified.
a - constant to subtractpublic Complex mult(double a)
this
is modified.
a - constant to multiplypublic Complex div(double a)
a(a shouldn't be 0).
this is modified.
a - constant to divide bypublic Complex sqrt()
public Complex exp()
e^(x+y*i) = e^x * e^(i*y) = e^x*(cos(y) + sin(y)).
public Complex log()
ln(x+y*i) = ln(r*e^(i*theta)) = ln(r) + i*theta.
public Complex pow(double a)
public Complex cosh()
cosh(k) = 1/2 * (e^k + e^k).
public Complex sinh()
sinh(k) = 1/2 * (e^k - e^k).
Complex j1mult()
Complex j2mult()
Complex j3mult()
public Complex cos()
cos(x+y*i) = cos(x)*cosh(y) - i*(sin(x)*sinh(y)).
public Complex sin()
sin(x+y*i) = sin(x)*cosh(y), i*(cos(x)*sinh(y))
public double doubleValue()
doubleValue in class Numberpublic float floatValue()
floatValue in class Numberpublic int intValue()
intValue in class Numberpublic long longValue()
longValue in class Number
public static Complex add(Complex z1,
Complex z2)
z1 - first complex numberz2 - second complex number
public static Complex sub(Complex z1,
Complex z2)
z1 - first complex numberz2 - second complex number (subtracted from the first)
public static Complex mult(Complex z1,
Complex z2)
z1 - first complex numberz2 - second complex number
public static Complex div(Complex z1,
Complex z2)
z1 - first complex numberz2 - second complex number
|
JIGL v1.6 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||