Package gnu.math

Class DComplex

  • All Implemented Interfaces:
    java.io.Externalizable, java.io.Serializable

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

      • DComplex

        public DComplex()
      • DComplex

        public DComplex​(double real,
                        double imag)
    • Method Detail

      • 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
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class Complex
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class Numeric
      • toString

        public java.lang.String toString​(int radix)
        Overrides:
        toString in class Complex
      • add

        public Numeric add​(java.lang.Object y,
                           int k)
        Description copied from class: Numeric
        Return this + k * obj.
        Overrides:
        add 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​(java.io.ObjectOutput out)
                           throws java.io.IOException
        Specified by:
        writeExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException
      • readExternal

        public void readExternal​(java.io.ObjectInput in)
                          throws java.io.IOException,
                                 java.lang.ClassNotFoundException
        Specified by:
        readExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException