Package gnu.math

Class DQuaternion

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

    public class DQuaternion
    extends Quaternion
    implements java.io.Externalizable
    A quaternion number using plain double values.
    See Also:
    Serialized Form
    • Constructor Detail

      • DQuaternion

        public DQuaternion()
      • DQuaternion

        public DQuaternion​(double real,
                           double imag,
                           double jmag,
                           double kmag)
    • 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
      • jm

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

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

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

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

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

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

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

        public Numeric add​(java.lang.Object y,
                           int k)
        Description copied from class: Numeric
        Return this + k * obj.
        Overrides:
        add in class Quaternion
      • hypot4

        public static double hypot4​(double w,
                                    double x,
                                    double y,
                                    double z)
      • hypot3

        public static double hypot3​(double x,
                                    double y,
                                    double z)
      • power

        public static Quaternion power​(double x_re,
                                       double x_im,
                                       double x_jm,
                                       double x_km,
                                       double y_re,
                                       double y_im,
                                       double y_jm,
                                       double y_km)
      • exp

        public static Quaternion exp​(double x_re,
                                     double x_im,
                                     double x_jm,
                                     double x_km)
      • log

        public static Quaternion log​(double x_re,
                                     double x_im,
                                     double x_jm,
                                     double x_km)
      • div

        public static Quaternion div​(double x_re,
                                     double x_im,
                                     double x_jm,
                                     double x_km,
                                     double y_re,
                                     double y_im,
                                     double y_jm,
                                     double y_km)
      • sqrt

        public static Quaternion sqrt​(double x_re,
                                      double x_im,
                                      double x_jm,
                                      double x_km)
      • sin

        public static Quaternion sin​(double x_re,
                                     double x_im,
                                     double x_jm,
                                     double x_km)
      • cos

        public static Quaternion cos​(double x_re,
                                     double x_im,
                                     double x_jm,
                                     double x_km)
      • tan

        public static Quaternion tan​(double x_re,
                                     double x_im,
                                     double x_jm,
                                     double x_km)
      • 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