Constructor and Description |
---|
ComplexDouble(double real,
double imag)
Create a complex with real and imaginary parts
|
Modifier and Type | Method and Description |
---|---|
ComplexDouble |
add(ComplexDouble complex)
Add a complex
|
ComplexDouble |
add(double scalar)
Add a scalar
|
ComplexDouble |
addi(ComplexDouble complex)
In place add a complex
|
ComplexDouble |
addi(double scalar)
In place add a scalar
|
java.lang.Object |
clone()
Returns a copy of this
ComplexDouble |
ComplexDouble |
conjugate()
Conjugate
|
ComplexDouble |
conjugatei()
In-place conjugate
|
ComplexDouble |
div(ComplexDouble complex)
Divide by a complex
|
ComplexDouble |
div(double scalar)
Divide by a scalar
|
ComplexDouble |
divi(ComplexDouble complex)
In place divide by a complex
|
ComplexDouble |
divi(double scalar)
In place divide by a scalar
|
boolean |
eq(ComplexDouble complex)
Equals between complex numbers
|
boolean |
equals(java.lang.Object object)
Compares this object against the specified object.
|
boolean |
ge(ComplexDouble complex)
Greater or equals between complex numbers' real parts
|
boolean |
ge(double scalar)
Greater or equals between complex number's real part and a scalar
|
double |
getImaginary()
Get the imaginary part of the complex
|
double |
getReal()
Get the real part of the complex
|
boolean |
gt(ComplexDouble complex)
Greater than between complex numbers' real parts
|
boolean |
gt(double scalar)
Greater than between complex number's real part and a scalar
|
int |
hashCode()
Returns a hash code for this object.
|
ComplexDouble |
inv()
Inversion
|
ComplexDouble |
invi()
In-place inversion
|
boolean |
isImaginary()
Test if complex is imaginary
|
boolean |
isNaN()
Returns true, if the current value is not a number.
|
boolean |
isReal()
Test if complex is real
|
boolean |
le(ComplexDouble complex)
Lower or equals between complex numbers' real parts
|
boolean |
le(double scalar)
Lower or equals between complex number's real part and a scalar
|
boolean |
lt(ComplexDouble complex)
Lower than between complex numbers' real parts
|
boolean |
lt(double scalar)
Lower than between complex number's real part and a scalar
|
static ComplexDouble |
minusOne()
Returns a new instance with (-1,0)
|
double |
modulus()
Absolute value/modulus/magnitude
|
ComplexDouble |
mul(ComplexDouble complex)
Multiply by a complex
|
ComplexDouble |
mul(double scalar)
Multiply by a scalar
|
ComplexDouble |
muli(ComplexDouble complex)
In place multiply by a complex
|
ComplexDouble |
muli(double scalar)
In place multiply by a scalar
|
static ComplexDouble |
NaN()
Returns a new instance with value (NaN,NaN)
|
boolean |
ne(ComplexDouble complex)
Not-equals between complex numbers
|
ComplexDouble |
neg()
Negate
|
ComplexDouble |
negi()
In-place negate
|
static ComplexDouble |
one()
Returns a new instance with (1,0)
|
void |
setImaginary(double imag)
Set the imaginary part of the complex
|
void |
setReal(double real)
Set the real part of the complex
|
ComplexDouble |
sqrt()
Positive square root.
|
ComplexDouble |
sqrti()
In-place positive square root.
|
ComplexDouble |
square()
Square
|
ComplexDouble |
squarei()
Square
|
ComplexDouble |
sub(ComplexDouble complex)
Subtract a complex
|
ComplexDouble |
sub(double scalar)
Subtract a scalar
|
ComplexDouble |
subi(ComplexDouble complex)
In place subtract a complex
|
ComplexDouble |
subi(double scalar)
In place subtract a scalar
|
ComplexDouble |
toComplexDouble()
Convert the current complex to ComplexDouble
|
ComplexFloat |
toComplexFloat()
Convert the current complex to ComplexFloat
|
double |
toDouble()
Convert the current complex to double
|
float |
toFloat()
Convert the current complex to float
|
java.lang.String |
toString()
Get string representation of this complex
|
static ComplexDouble |
zero()
Returns a new instance with (0,0)
|
public ComplexDouble(double real, double imag)
real
- Real part of the compleximag
- Imaginary part of the complexpublic java.lang.Object clone()
ComplexDouble
clone
in class java.lang.Object
ComplexDouble
public double getReal()
public void setReal(double real)
real
- Real part of the complex to setpublic boolean isReal()
public double getImaginary()
public void setImaginary(double imag)
imag
- Imaginary part of the complex to setpublic boolean isImaginary()
public boolean isNaN()
public static ComplexDouble minusOne()
public static ComplexDouble zero()
public static ComplexDouble one()
public static ComplexDouble NaN()
public ComplexDouble add(ComplexDouble complex)
complex
- The complex to add to the current complexpublic ComplexDouble addi(ComplexDouble complex)
complex
- The complex to add to the current complexpublic ComplexDouble add(double scalar)
scalar
- The scalar to add to the current complexpublic ComplexDouble addi(double scalar)
scalar
- The scalar to add to the current complexpublic ComplexDouble sub(ComplexDouble complex)
complex
- The complex to subtract to the current complexpublic ComplexDouble subi(ComplexDouble complex)
complex
- The complex to subtract to the current complexpublic ComplexDouble sub(double scalar)
scalar
- The scalar to subtract to the current complexpublic ComplexDouble subi(double scalar)
scalar
- The scalar to subtract to the current complexpublic ComplexDouble mul(ComplexDouble complex)
complex
- The complex to multiply the current complex bypublic ComplexDouble muli(ComplexDouble complex)
complex
- The complex to multiply the current complex bypublic ComplexDouble mul(double scalar)
scalar
- The scalar to multiply the current complex bypublic ComplexDouble muli(double scalar)
scalar
- The scalar to multiply the current complex bypublic ComplexDouble div(ComplexDouble complex)
complex
- The complex to divide the current complex bypublic ComplexDouble divi(ComplexDouble complex)
complex
- The complex to divide the current complex bypublic ComplexDouble div(double scalar)
scalar
- The scalar to divide the current complex bypublic ComplexDouble divi(double scalar)
scalar
- The scalar to divide the current complex bypublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
object
- Other object to compare complex withpublic boolean eq(ComplexDouble complex)
complex
- The complex to compare the current complex withpublic boolean ne(ComplexDouble complex)
complex
- The complex to compare the current complex withpublic boolean gt(ComplexDouble complex)
complex
- The complex to compare the current complex withpublic boolean gt(double scalar)
scalar
- The scalar to compare the elements of the complex withpublic boolean lt(ComplexDouble complex)
complex
- The complex to compare the current complex withpublic boolean lt(double scalar)
scalar
- The scalar to compare the elements of the complex withpublic boolean ge(ComplexDouble complex)
complex
- The complex to compare the current complex withpublic boolean ge(double scalar)
scalar
- The scalar to compare the elements of the complex withpublic boolean le(ComplexDouble complex)
complex
- The complex to compare the current complex withpublic boolean le(double scalar)
scalar
- The scalar to compare the elements of the complex withpublic ComplexDouble conjugate()
ComplexDouble
but the value is
conjugated (imaginary part is negated)public ComplexDouble conjugatei()
public ComplexDouble neg()
ComplexDouble
but the value is
negated (both real and imaginary parts are negated)public ComplexDouble negi()
public ComplexDouble inv()
ComplexDouble
with the inverse valuejava.lang.ArithmeticException
- if the ComplexDouble
cannot be inverted (real^2+imaginary^2==0)public ComplexDouble invi()
java.lang.ArithmeticException
- if the ComplexDouble
cannot be inverted (real^2+imaginary^2==0)public double modulus()
result = Math.sqrt( real * real + imag * imag )
ComplexDouble
with the absolute valuepublic ComplexDouble sqrt()
ComplexDouble
with the positive square rootpublic ComplexDouble sqrti()
public ComplexDouble square()
ComplexDouble
with the squarepublic ComplexDouble squarei()
public java.lang.String toString()
toString
in class java.lang.Object
public float toFloat()
public double toDouble()
public ComplexFloat toComplexFloat()
toComplexFloat
in interface Complex
public ComplexDouble toComplexDouble()
toComplexDouble
in interface Complex