Class ComplexNumber

java.lang.Object
ffx.numerics.math.ComplexNumber

public class ComplexNumber extends Object
ComplexNumber class.
Since:
1.0
Author:
Timothy D. Fenn
  • Constructor Details

    • ComplexNumber

      public ComplexNumber()
      Constructor for ComplexNumber.
    • ComplexNumber

      public ComplexNumber(double real, double imag)
      Constructor for ComplexNumber.
      Parameters:
      real - a double.
      imag - a double.
  • Method Details

    • phaseShift

      public static ComplexNumber phaseShift(ComplexNumber a, double s)
      Static version of phaseShift.
      Parameters:
      a - a ComplexNumber object.
      s - a double.
      Returns:
      a ComplexNumber object.
    • abs

      public double abs()
      abs
      Returns:
      a double.
    • conjugate

      public ComplexNumber conjugate()
      Return a new Complex object whose value is the conjugate of this.
      Returns:
      a ComplexNumber object.
    • conjugateIP

      public void conjugateIP()
      conjugateIP
    • copy

      public void copy(ComplexNumber b)
      copy
      Parameters:
      b - a ComplexNumber object.
    • cos

      public ComplexNumber cos()
      Return a new Complex object whose value is the complex cosine of this.
      Returns:
      a ComplexNumber object.
    • divides

      public ComplexNumber divides(ComplexNumber b)
      Return a / b.
      Parameters:
      b - a ComplexNumber object.
      Returns:
      a ComplexNumber object.
    • exp

      public ComplexNumber exp()
      Return a new Complex object whose value is the complex exponential of this.
      Returns:
      a ComplexNumber object.
    • im

      public double im()
      im
      Returns:
      a double.
    • im

      public void im(double im)
      im
      Parameters:
      im - a double.
    • minus

      public ComplexNumber minus(ComplexNumber b)
      Return a new Complex object whose value is (this - b).
      Parameters:
      b - a ComplexNumber object.
      Returns:
      a ComplexNumber object.
    • minusIP

      public void minusIP(ComplexNumber b)
      minusIP
      Parameters:
      b - a ComplexNumber object.
    • phase

      public double phase()
      phase
      Returns:
      a double.
    • phaseShift

      public ComplexNumber phaseShift(double s)
      phaseShift
      Parameters:
      s - a double.
      Returns:
      a ComplexNumber object.
    • phaseShiftIP

      public void phaseShiftIP(double s)
      phaseShiftIP
      Parameters:
      s - a double.
    • plus

      public ComplexNumber plus(ComplexNumber b)
      Return a new Complex object whose value is (this + b).
      Parameters:
      b - a ComplexNumber object.
      Returns:
      a ComplexNumber object.
    • plusIP

      public void plusIP(ComplexNumber b)
      plusIP
      Parameters:
      b - a ComplexNumber object.
    • re

      public double re()
      re
      Returns:
      a double.
    • re

      public void re(double re)
      re
      Parameters:
      re - a double.
    • reciprocal

      public ComplexNumber reciprocal()
      Return a new Complex object whose value is the reciprocal of this.
      Returns:
      a ComplexNumber object.
    • reciprocalIP

      public void reciprocalIP()
      reciprocalIP
    • sin

      public ComplexNumber sin()
      Return a new Complex object whose value is the complex sine of this.
      Returns:
      a ComplexNumber object.
    • tan

      public ComplexNumber tan()
      Return a new Complex object whose value is the complex tangent of this.
      Returns:
      a ComplexNumber object.
    • times

      public ComplexNumber times(ComplexNumber b)
      Return a new Complex object whose value is (this * b).
      Parameters:
      b - a ComplexNumber object.
      Returns:
      a ComplexNumber object.
    • times

      public ComplexNumber times(double alpha)
      Return a new object whose value is (this * alpha).
      Parameters:
      alpha - a double.
      Returns:
      a ComplexNumber object.
    • timesIP

      public void timesIP(ComplexNumber b)
      timesIP
      Parameters:
      b - a ComplexNumber object.
    • timesIP

      public void timesIP(double alpha)
      timesIP
      Parameters:
      alpha - a double.
    • toString

      public String toString()
      Overrides:
      toString in class Object