Package com.xinapse.image
Class Complex
java.lang.Object
com.xinapse.image.Complex
- Direct Known Subclasses:
DoubleComplex
,FloatComplex
A complex (real, imaginary) number.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract Complex
Adds the value of this complex number to another complex number, and returns the result.abstract Complex
conj()
Returns the complex conjugate of this complex number.abstract Complex
Divides this complex by another complex number, and returns the result.abstract Complex
expi()
Returns the exponential of this complex number multiplied by i.abstract double
getArg()
Returns the polar angle of this complex number.abstract double
getImag()
Returns the imaginary part of this complex number.abstract double
getMod()
Returns the modulus of this complex number.abstract double
getModSq()
Returns the square of the modulus of this complex number.abstract double
getReal()
Returns the real part of this complex number.double
getValue
(ComplexMode complexMode) Returns a (real-valued) component of thisComplex
.abstract boolean
isZero()
Tests whether this complex number is zero.abstract Complex
log()
Returns the natural log of this complex number.abstract Complex
Multiplies this complex number by another complex number, and returns the result.abstract Complex
scale
(double factor) Scales this Complex by a real scalar value and returns the result.abstract Complex
Subtracts another complex number from this complex number, and returns the result.abstract String
toString()
Returns a string representation of this complex number.
-
Constructor Details
-
Complex
public Complex()
-
-
Method Details
-
getReal
public abstract double getReal()Returns the real part of this complex number.- Returns:
- the real part of this complex number.
-
getImag
public abstract double getImag()Returns the imaginary part of this complex number.- Returns:
- the imaginary part of this complex number.
-
getArg
public abstract double getArg()Returns the polar angle of this complex number.- Returns:
- the polar angle of this complex number.
-
getMod
public abstract double getMod()Returns the modulus of this complex number.- Returns:
- the modulus of this complex number.
-
getModSq
public abstract double getModSq()Returns the square of the modulus of this complex number.- Returns:
- the square of the modulus of this complex number.
-
add
Adds the value of this complex number to another complex number, and returns the result.- Parameters:
cmplx
- the complex number to add.- Returns:
- the result of adding this to another complex number.
-
subtract
Subtracts another complex number from this complex number, and returns the result.- Parameters:
cmplx
- the complex number to subtract.- Returns:
- the result of subtracting another complex number from this.
-
multiply
Multiplies this complex number by another complex number, and returns the result.- Parameters:
cmplx
- the complex by which to multiply.- Returns:
- the result of multiplying this by another complex number.
-
divide
Divides this complex by another complex number, and returns the result.- Parameters:
cmplx
- the complex by which to divide.- Returns:
- the result of dividing this by another complex number.
-
scale
Scales this Complex by a real scalar value and returns the result.- Parameters:
factor
- the real scalar value by which to scale.- Returns:
- the result of scaling this Complex by a real scalar value.
-
conj
Returns the complex conjugate of this complex number.- Returns:
- the complex conjugate of this complex number.
-
expi
Returns the exponential of this complex number multiplied by i.- Returns:
- the exponential of this complex number multiplied by i.
-
log
Returns the natural log of this complex number.- Returns:
- the natural log of this complex number.
-
isZero
public abstract boolean isZero()Tests whether this complex number is zero.- Returns:
- true if both the real and imaginary components are zero; false otherwise.
-
getValue
Returns a (real-valued) component of thisComplex
. -
toString
Returns a string representation of this complex number.
-