public class ComplexUtils
extends java.lang.Object
Constructor and Description |
---|
ComplexUtils() |
Modifier and Type | Method and Description |
---|---|
static double |
abs(ComplexNumber num)
Returns the absolute value of the complex number.
|
static Complex |
acos(ComplexNumber c)
Calculate the inverse cosine of a complex number.
|
static Complex |
acosh(ComplexNumber c)
Calculate the inverse hyperbolic cosine of a complex number.
|
static Complex |
add(ComplexNumber a,
ComplexNumber b)
Add a complex number to a complex number
|
static Complex |
add(ComplexNumber a,
double b)
Add a real number to a complex number
|
static Complex |
add(double a,
ComplexNumber b)
Add a complex number to a real number
|
static double |
arg(ComplexNumber num)
Calculates the argument of this complex number.
|
static Complex |
asin(ComplexNumber c)
Calculate the inverse sine of a complex number.
|
static Complex |
asinh(ComplexNumber c)
Calculate the inverse hyperbolic sine of a complex number.
|
static Complex |
atan(ComplexNumber c)
Calculate the inverse tangent of a complex number.
|
static Complex |
atanh(ComplexNumber c)
Calculate the inverse hyperbolic tangent of a complex number.
|
static Complex |
conjugate(ComplexNumber a)
Calculates the conjugate of a complex number
|
static Complex |
cos(ComplexNumber c)
Calculate the cosine of a complex number.
|
static Complex |
cosh(ComplexNumber c)
Calculate the hyperbolic cosine of a complex number.
|
static Complex |
divide(ComplexNumber a,
ComplexNumber b)
Divide a complex number by a complex number
|
static Complex |
divide(ComplexNumber a,
double d)
Divide a complex number by a real number
|
static Complex |
divide(double d,
ComplexNumber c)
Divide a real number by a complex number
|
static boolean |
equal(ComplexNumber a,
ComplexNumber b)
Compare two complex numbers with all cases of NaN considered equal.
|
static boolean |
equalRealImag(ComplexNumber a,
ComplexNumber b)
Compare the real and imaginary parts of two complex numbers.
|
static Complex |
exp(ComplexNumber c)
Calculates the exponential of the complex number.
|
static Complex |
expm1(ComplexNumber c)
Returns exp(c)-1.
|
static int |
hashCode(ComplexNumber c)
Returns a hash code of the complex number.
|
static Complex |
invert(ComplexNumber c)
Calculates the inverse of a complex number
|
static boolean |
isInfinite(ComplexNumber n)
Returns whether the complex number is infinite.
|
static boolean |
isNaN(ComplexNumber n)
Returns whether the complex number is NaN.
|
static Complex |
log(ComplexNumber c)
Calculates the natural logarithm of the complex number.
|
static Complex |
log1p(ComplexNumber c)
Returns log(c+1).
|
static boolean |
longBitsEqual(ComplexNumber a,
ComplexNumber b)
Compare the bit representations of real and imaginary parts of two
complex numbers.
|
static Complex |
multiply(ComplexNumber a,
ComplexNumber b)
Multiply a complex number by a complex number
|
static Complex |
multiply(ComplexNumber a,
double d)
Multiply a complex number by a real number
|
static Complex |
multiply(ComplexNumber a,
int i)
Multiply a complex number by an integer
|
static Complex |
multiply(double d,
ComplexNumber a)
Multiply a real number by a complex number
|
static Complex |
multiply(int i,
ComplexNumber a)
Multiply an integer by a complex number
|
static Complex |
negate(ComplexNumber a)
Calculates the negation of a complex number
|
static Complex |
newPolar(double abs,
double argument)
Create a complex number from polar coordinates.
|
static Complex |
pow(ComplexNumber a,
ComplexNumber b)
Raise a complex number to a complex power
|
static Complex |
pow(ComplexNumber a,
double b)
Raise a complex number to a real power
|
static Complex |
sin(ComplexNumber c)
Calculate the sine of a complex number.
|
static Complex |
sinh(ComplexNumber c)
Calculate the hyperbolic sine of a complex number.
|
static Complex |
sqrt(ComplexNumber c)
Calculates the square root of a complex number
|
static Complex |
subtract(ComplexNumber a,
ComplexNumber b)
Subtract a complex number from a complex number
|
static Complex |
subtract(ComplexNumber a,
double b)
Subtract a real number from a complex number
|
static Complex |
subtract(double a,
ComplexNumber b)
Subtract a complex number from a real number
|
static Complex |
tan(ComplexNumber c)
Calculate the tangent of a complex number.
|
static Complex |
tanh(ComplexNumber c)
Calculate the hyperbolic tangent of a complex number.
|
static java.lang.String |
toString(ComplexNumber num)
Returns a String representation of a complex number.
|
public static boolean isNaN(ComplexNumber n)
n
- The complex numberpublic static boolean isInfinite(ComplexNumber n)
n
- The complex numberpublic static double abs(ComplexNumber num)
num
- The complex numberpublic static double arg(ComplexNumber num)
public static Complex newPolar(double abs, double argument)
abs
- The absolute valueargument
- The argumentpublic static Complex pow(ComplexNumber a, double b)
a
- The complex baseb
- The real powerpublic static Complex pow(ComplexNumber a, ComplexNumber b)
a
- The complex baseb
- The complex powerpublic static java.lang.String toString(ComplexNumber num)
public static Complex add(ComplexNumber a, ComplexNumber b)
a
- A complex numberb
- A complex numberpublic static Complex add(ComplexNumber a, double b)
a
- The complex numberb
- The real numberpublic static Complex add(double a, ComplexNumber b)
a
- The real numberb
- The complex numberpublic static Complex subtract(ComplexNumber a, ComplexNumber b)
a
- The minuendb
- The subtrahendpublic static Complex subtract(ComplexNumber a, double b)
a
- The complex numberb
- The real numberpublic static Complex subtract(double a, ComplexNumber b)
a
- The real numberb
- The complex numberpublic static Complex multiply(ComplexNumber a, ComplexNumber b)
a
- A complex numberb
- A complex numberpublic static Complex divide(ComplexNumber a, ComplexNumber b)
a
- The dividendb
- The divisorpublic static Complex divide(ComplexNumber a, double d)
a
- The complex numberd
- The real numberpublic static Complex multiply(ComplexNumber a, double d)
a
- The complex numberd
- The real numberpublic static Complex multiply(double d, ComplexNumber a)
d
- The real numbera
- The complex numberpublic static Complex multiply(ComplexNumber a, int i)
a
- The complex numberi
- The integerpublic static Complex multiply(int i, ComplexNumber a)
i
- The integera
- The complex numberpublic static Complex negate(ComplexNumber a)
a
- The complex numberpublic static Complex conjugate(ComplexNumber a)
a
- The complex numberpublic static Complex divide(double d, ComplexNumber c)
d
- The real numberc
- The complex numberpublic static Complex invert(ComplexNumber c)
c
- The complex numberpublic static Complex sqrt(ComplexNumber c)
c
- The complex numberpublic static Complex exp(ComplexNumber c)
c
- The complex numberpublic static Complex log(ComplexNumber c)
c
- The complex numberpublic static Complex log1p(ComplexNumber c)
c
- The complex numberpublic static Complex expm1(ComplexNumber c)
c
- The complex numberpublic static Complex acosh(ComplexNumber c)
c
- The complex numberpublic static Complex asinh(ComplexNumber c)
c
- The complex numberpublic static Complex atanh(ComplexNumber c)
c
- The complex numberpublic static Complex acos(ComplexNumber c)
c
- The complex numberpublic static Complex asin(ComplexNumber c)
c
- The complex numberpublic static Complex atan(ComplexNumber c)
c
- The complex numberpublic static Complex cos(ComplexNumber c)
c
- The complex numberpublic static Complex sin(ComplexNumber c)
c
- The complex numberpublic static Complex tan(ComplexNumber c)
c
- The complex numberpublic static Complex cosh(ComplexNumber c)
c
- The complex numberpublic static Complex sinh(ComplexNumber c)
c
- The complex numberpublic static Complex tanh(ComplexNumber c)
c
- The complex numberpublic static int hashCode(ComplexNumber c)
public static boolean equal(ComplexNumber a, ComplexNumber b)
public static boolean longBitsEqual(ComplexNumber a, ComplexNumber b)
public static boolean equalRealImag(ComplexNumber a, ComplexNumber b)