Class Complex
java.lang.Object
com.xinapse.image.Complex
- Direct Known Subclasses:
DoubleComplex, FloatComplex
A complex (real, imaginary) number.
-
Method Summary
Modifier and TypeMethodDescriptionabstract ComplexAdds the value of this complex number to another complex number, and returns the result.abstract Complexconj()Returns the complex conjugate of this complex number.abstract ComplexDivides this complex by another complex number, and returns the result.abstract Complexexpi()Returns the exponential of this complex number multiplied by i.abstract doublegetArg()Returns the polar angle of this complex number.abstract doublegetImag()Returns the imaginary part of this complex number.abstract doublegetMod()Returns the modulus of this complex number.abstract doublegetModSq()Returns the square of the modulus of this complex number.abstract doublegetReal()Returns the real part of this complex number.abstract ComplexgetSign()Returns this complex number divided by its absolute value.doublegetValue(ComplexMode complexMode) Returns a (real-valued) component of thisComplex.abstract booleanisZero()Tests whether this complex number is zero.abstract Complexlog()Returns the natural log of this complex number.abstract ComplexMultiplies this complex number by another complex number, and returns the result.abstract Complexscale(double factor) Scales this Complex by a real scalar value and returns the result.abstract ComplexSubtracts another complex number from this complex number, and returns the result.abstract StringtoString()Returns a string representation of this complex number.
-
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.
-
getSign
Returns this complex number divided by its absolute value.- Returns:
- this complex number divided by its absolute value.
-
add
-
subtract
-
multiply
-
divide
-
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
-