Package gnu.math

Class DComplex

All Implemented Interfaces:
Externalizable, Serializable

public class DComplex extends Complex implements Externalizable
A complex number using rectangular (Cartesian) plain double values.
See Also:
  • Constructor Details

    • DComplex

      public DComplex()
    • DComplex

      public DComplex(double real, double imag)
  • Method Details

    • re

      public RealNum re()
      Description copied from class: Quantity
      The value of the real component, as a RealNum. The unit() is not factored in, so you actually need to multiply by unit() to get the true real component.
      Overrides:
      re in class Quantity
    • doubleValue

      public double doubleValue()
      Description copied from class: Quantity
      The value of the real component, as a double. This is relative to the unit().dims - i.e. unit()/doubleValue() is factored in.
      Overrides:
      doubleValue in class Quaternion
    • im

      public RealNum im()
      Description copied from class: Quantity
      The value of the imaginary component, as a RealNum. The unit() is not factored in, so you actually need to multiply by unit() to get the true imaginary component.
      Overrides:
      im in class Quantity
    • doubleImagValue

      public double doubleImagValue()
      Description copied from class: Quantity
      The value of the imaginary component, as a double. This is relative to the unit().dims - i.e. unit()/doubleValue() is factored in.
      Overrides:
      doubleImagValue in class Quaternion
    • isExact

      public boolean isExact()
      Overrides:
      isExact in class Complex
    • toExact

      public Complex toExact()
      Overrides:
      toExact in class Complex
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Complex
    • toString

      public String toString()
      Overrides:
      toString in class Numeric
    • toString

      public String toString(int radix)
      Overrides:
      toString in class Complex
    • neg

      public final Numeric neg()
      Overrides:
      neg in class Complex
    • add

      public Numeric add(Object y, int k)
      Description copied from class: Numeric
      Return this + k * obj.
      Overrides:
      add in class Complex
    • mul

      public Numeric mul(Object y)
      Overrides:
      mul in class Complex
    • div

      public Numeric div(Object y)
      Overrides:
      div in class Complex
    • power

      public static Complex power(double x_re, double x_im, double y_re, double y_im)
    • log

      public static Complex log(double x_re, double x_im)
    • div

      public static DComplex div(double x_re, double x_im, double y_re, double y_im)
    • sqrt

      public static Complex sqrt(double x_re, double x_im)
    • sin

      public static Complex sin(double x_re, double x_im)
    • cos

      public static Complex cos(double x_re, double x_im)
    • tan

      public static Complex tan(double x_re, double x_im)
    • unitQuaternion

      public static Complex unitQuaternion(double x_re, double x_im)
    • writeExternal

      public void writeExternal(ObjectOutput out) throws IOException
      Specified by:
      writeExternal in interface Externalizable
      Throws:
      IOException
    • readExternal

      public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
      Specified by:
      readExternal in interface Externalizable
      Throws:
      IOException
      ClassNotFoundException