Class Vector4d

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Vector4d>

    public class Vector4d
    extends java.lang.Object
    implements java.lang.Comparable<Vector4d>, java.io.Serializable
    3D Vector object (X,Y,Z,W).
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      Vector4d()
      construction, initialized to 0,0,0,0
      Vector4d​(double[] afTuple)
      construction
      Vector4d​(double fX, double fY, double fZ, double fW)
      construction
      Vector4d​(Vector4d rkV)
      copy construction
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      int compare​(Vector4d arg0, Vector4d arg1)
      Sorting a list of Vector3d in order, where each element is a column when two Vector3d have equal X then the sort is by Y.
      int compareTo​(Vector4d arg0)  
      Vector4d copy​(Vector4d rkV)
      Set the values of this vector.
      void Copy​(Vector4d rkV)
      Deprecated. 
      double dot​(Vector4d rkV)
      Compute dot-product of this vector with input vector:
      double Dot​(Vector4d rkV)
      Deprecated. 
      boolean equals​(java.lang.Object kObject)  
      int hashCode()  
      boolean isEqual​(Vector4d rkV)
      Return true if the input Vector4d is equal to this.
      boolean IsEqual​(Vector4d rkV)
      Deprecated. 
      double length()
      Compute length this vector:
      double Length()
      Deprecated. 
      Vector4d neg​(Vector4d kV)
      Negate this vector: this = - this.
      void Neg​(Vector4d kV)
      Deprecated. 
      double normalize()
      Normalize this vector, return original length:
      double Normalize()
      Deprecated. 
      Vector4d scale​(double fScalar)
      Scale this vector by input: this = this * fScalar.
      void Scale​(double fScalar)
      Deprecated. 
      Vector4d set​(double fX, double fY, double fZ, double fW)
      Set the values of this vector.
      void Set​(double fX, double fY, double fZ, double fW)
      Deprecated. 
      double squaredLength()
      Compute squared-length this vector:
      double SquaredLength()
      Deprecated. 
      double sum()
      Sum the elements of the vector.
      double Sum()
      Deprecated. 
      java.lang.String toString()
      Returns a string representation of the vector values.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • ZERO

        public static final Vector4d ZERO
        Zero vector: (0,0,0,0)
      • UNIT_X

        public static final Vector4d UNIT_X
        Unit-X vector: (1,0,0,0)
      • UNIT_Y

        public static final Vector4d UNIT_Y
        Unit-Y vector: (0,1,0,0)
      • UNIT_Z

        public static final Vector4d UNIT_Z
        Unit-Z vector: (0,0,1,0)
      • UNIT_W

        public static final Vector4d UNIT_W
        Unit-W vector: (0,0,0,1)
      • ONE

        public static final Vector4d ONE
        One vector: (1,1,1,1)
      • X

        public double X
        Vector data:
      • Y

        public double Y
      • Z

        public double Z
      • W

        public double W
    • Constructor Detail

      • Vector4d

        public Vector4d()
        construction, initialized to 0,0,0,0
      • Vector4d

        public Vector4d​(double fX,
                        double fY,
                        double fZ,
                        double fW)
        construction
        Parameters:
        fX - x-value
        fY - y-value
        fZ - z-value
        fW - w-value
      • Vector4d

        public Vector4d​(double[] afTuple)
        construction
        Parameters:
        afTuple - x,y,z,w values
      • Vector4d

        public Vector4d​(Vector4d rkV)
        copy construction
        Parameters:
        rkV - vector to copy.
    • Method Detail

      • Copy

        public void Copy​(Vector4d rkV)
        Deprecated.
        Set the values of this vector.
        Parameters:
        rkV - vector to copy.
      • copy

        public Vector4d copy​(Vector4d rkV)
        Set the values of this vector.
        Parameters:
        rkV - vector to copy.
      • Dot

        public double Dot​(Vector4d rkV)
        Deprecated.
        Compute dot-product of this vector with input vector:
        Returns:
        dot-product of this vector with input vector:
      • dot

        public double dot​(Vector4d rkV)
        Compute dot-product of this vector with input vector:
        Returns:
        dot-product of this vector with input vector:
      • equals

        public boolean equals​(java.lang.Object kObject)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • IsEqual

        public boolean IsEqual​(Vector4d rkV)
        Deprecated.
        Return true if the input Vector4d is equal to this.
        Parameters:
        rkV - input vector to compare to this
        Returns:
        true if the input Vector4d is equal to this, false otherwise.
      • isEqual

        public boolean isEqual​(Vector4d rkV)
        Return true if the input Vector4d is equal to this.
        Parameters:
        rkV - input vector to compare to this
        Returns:
        true if the input Vector4d is equal to this, false otherwise.
      • Length

        public double Length()
        Deprecated.
        Compute length this vector:
        Returns:
        length this vector
      • length

        public double length()
        Compute length this vector:
        Returns:
        length this vector
      • Neg

        public void Neg​(Vector4d kV)
        Deprecated.
        Negate this vector: this = - this.
      • Normalize

        public double Normalize()
        Deprecated.
        Normalize this vector, return original length:
        Returns:
        original length:
      • normalize

        public double normalize()
        Normalize this vector, return original length:
        Returns:
        original length:
      • Scale

        public void Scale​(double fScalar)
        Deprecated.
        Scale this vector by input: this = this * fScalar.
        Parameters:
        fScalar - scale value
      • scale

        public Vector4d scale​(double fScalar)
        Scale this vector by input: this = this * fScalar.
        Parameters:
        fScalar - scale value
      • Set

        public void Set​(double fX,
                        double fY,
                        double fZ,
                        double fW)
        Deprecated.
        Set the values of this vector.
        Parameters:
        fX - x-value
        fY - y-value
        fZ - z-value
        fW - w-value
      • set

        public Vector4d set​(double fX,
                            double fY,
                            double fZ,
                            double fW)
        Set the values of this vector.
        Parameters:
        fX - x-value
        fY - y-value
        fZ - z-value
        fW - w-value
      • SquaredLength

        public double SquaredLength()
        Deprecated.
        Compute squared-length this vector:
        Returns:
        squared-length this vector
      • squaredLength

        public double squaredLength()
        Compute squared-length this vector:
        Returns:
        squared-length this vector
      • Sum

        public double Sum()
        Deprecated.
        Sum the elements of the vector.
        Returns:
        vector sum
      • sum

        public double sum()
        Sum the elements of the vector.
        Returns:
        vector sum
      • toString

        public java.lang.String toString()
        Returns a string representation of the vector values.
        Overrides:
        toString in class java.lang.Object
        Returns:
        string representation of the vector values.
      • compare

        public int compare​(Vector4d arg0,
                           Vector4d arg1)
        Sorting a list of Vector3d in order, where each element is a column when two Vector3d have equal X then the sort is by Y.
        Parameters:
        arg0 -
        arg1 -
        Returns:
      • compareTo

        public int compareTo​(Vector4d arg0)
        Specified by:
        compareTo in interface java.lang.Comparable<Vector4d>