Class Complex

java.lang.Object
com.xinapse.image.Complex
Direct Known Subclasses:
DoubleComplex, FloatComplex

public abstract class Complex extends Object
A complex (real, imaginary) number.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract Complex
    add(Complex cmplx)
    Adds the value of this complex number to another complex number, and returns the result.
    abstract Complex
    Returns the complex conjugate of this complex number.
    abstract Complex
    divide(Complex cmplx)
    Divides this complex by another complex number, and returns the result.
    abstract Complex
    Returns the exponential of this complex number multiplied by i.
    abstract double
    Returns the polar angle of this complex number.
    abstract double
    Returns the imaginary part of this complex number.
    abstract double
    Returns the modulus of this complex number.
    abstract double
    Returns the square of the modulus of this complex number.
    abstract double
    Returns the real part of this complex number.
    double
    getValue(ComplexMode complexMode)
    Returns a (real-valued) component of this Complex.
    abstract boolean
    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
    Returns a string representation of this complex number.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • 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

      public abstract Complex add(Complex cmplx)
      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

      public abstract Complex subtract(Complex cmplx)
      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

      public abstract Complex multiply(Complex cmplx)
      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

      public abstract Complex divide(Complex cmplx)
      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

      public abstract Complex scale(double factor)
      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

      public abstract Complex conj()
      Returns the complex conjugate of this complex number.
      Returns:
      the complex conjugate of this complex number.
    • expi

      public abstract Complex expi()
      Returns the exponential of this complex number multiplied by i.
      Returns:
      the exponential of this complex number multiplied by i.
    • log

      public abstract Complex 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

      public double getValue(ComplexMode complexMode)
      Returns a (real-valued) component of this Complex.
      Parameters:
      complexMode - the component of this Complex to return.
      Returns:
      one of the components of this Complex.
    • toString

      public abstract String toString()
      Returns a string representation of this complex number.
      Overrides:
      toString in class Object
      Returns:
      string representation of this complex.