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
Constructors -
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.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.
-
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.
-