Class Vector3d


  • public class Vector3d
    extends java.lang.Object
    Author:
    Pierre Lando
    • Constructor Detail

      • Vector3d

        public Vector3d​(Vector3d v)
      • Vector3d

        public Vector3d​(double x,
                        double y,
                        double z)
      • Vector3d

        public Vector3d​(float[] position)
      • Vector3d

        public Vector3d​(double[] position)
      • Vector3d

        public Vector3d​(java.lang.Double[] position)
    • Method Detail

      • getX

        public double getX()
      • getY

        public double getY()
      • getZ

        public double getZ()
      • toString

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

        public double[] getData()
      • getDataAsFloatArray

        public float[] getDataAsFloatArray()
      • getDataAsFloatArray

        public float[] getDataAsFloatArray​(int size)
      • times

        public Vector3d times​(double d)
      • getNormalized

        public Vector3d getNormalized()
      • getNorm

        public double getNorm()
      • getNorm2

        public double getNorm2()
      • scalar

        public double scalar​(Vector3d v)
      • product

        public static Vector3d product​(Vector3d v1,
                                       Vector3d v2)
        Create a new vector cross-product of the given vectors.
        Parameters:
        v1 - the first given vector.
        v2 - the second given vector.
        Returns:
        a new vector cross-product of the given vectors.
      • setX

        public Vector3d setX​(double x)
        Create a new vector, copy of this one, with a new X value.
        Parameters:
        x - the new X value.
        Returns:
        a new vector, copy of this one, with a new X value.
      • setY

        public Vector3d setY​(double y)
        Create a new vector, copy of this one, with a new Y value.
        Parameters:
        y - the new Y value.
        Returns:
        a new vector, copy of this one, with a new Y value.
      • setZ

        public Vector3d setZ​(double z)
        Create a new vector, copy of this one, with a new Z value.
        Parameters:
        z - the new Z value.
        Returns:
        a new vector, copy of this one, with a new Z value.
      • isZero

        public boolean isZero()
        Return true if this vector is (0, 0, 0).
        Returns:
        true if this vector is (0, 0, 0).
      • isNearZero

        public boolean isNearZero()
        Return true if this vector is (0, 0, 0).
        Returns:
        true if this vector is (0, 0, 0).
      • equals

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

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