Class Vector3i

    • Constructor Detail

      • Vector3i

        public Vector3i()
        Construct a zero vector.
      • Vector3i

        public Vector3i​(Tuple3D<?> tuple)
        Constructor by copy.
        Parameters:
        tuple - is the tuple to copy.
      • Vector3i

        public Vector3i​(int[] tuple)
        Constructor by copy.
        Parameters:
        tuple - is the tuple to copy.
      • Vector3i

        public Vector3i​(double[] tuple)
        Constructor by copy.
        Parameters:
        tuple - is the tuple to copy.
      • Vector3i

        public Vector3i​(int x,
                        int y,
                        int z)
        Constructor a vector with the given coordinates.
        Parameters:
        x - x coordinate.
        y - y coordinate.
        z - z coordinate.
      • Vector3i

        public Vector3i​(float x,
                        float y,
                        float z)
        Constructor a vector with the given coordinates.
        Parameters:
        x - x coordinate.
        y - y coordinate.
        z - z coordinate.
      • Vector3i

        public Vector3i​(double x,
                        double y,
                        double z)
        Constructor a vector with the given coordinates.
        Parameters:
        x - x coordinate.
        y - y coordinate.
        z - z coordinate.
      • Vector3i

        public Vector3i​(long x,
                        long y,
                        long z)
        Constructor a vector with the given coordinates.
        Parameters:
        x - x coordinate.
        y - y coordinate.
        z - z coordinate.
    • Method Detail

      • convert

        public static Vector3i convert​(Tuple3D<?> tuple)
        Convert the given tuple to a real Vector3i.

        If the given tuple is already a Vector3i, it is replied.

        Parameters:
        tuple - the tuple.
        Returns:
        the Vector3i.
        Since:
        14.0
      • dot

        @Pure
        public double dot​(Vector3D<?,​?> vector)
        Description copied from interface: Vector3D
        Computes the dot product of the this vector and vector v1.
        Specified by:
        dot in interface Vector3D<Vector3i,​Point3i>
        Parameters:
        vector - the other vector
        Returns:
        the dot product.
      • perp

        @Pure
        public double perp​(Vector3D<?,​?> vector)
        Description copied from interface: Vector3D
        Compute the determinant of two vectors.
        det(this, V) = |this|.|V|.sin(a)
        where this and V are two vectors and a is the angle between this and V.
        Specified by:
        perp in interface Vector3D<Vector3i,​Point3i>
        Parameters:
        vector - the vector.
        Returns:
        the perp product.
      • getLength

        @Pure
        public double getLength()
        Description copied from interface: Vector3D
        Returns the length of this vector.
        Specified by:
        getLength in interface Vector3D<Vector3i,​Point3i>
        Returns:
        the length of this vector
      • getLengthSquared

        @Pure
        public double getLengthSquared()
        Description copied from interface: Vector3D
        Returns the squared length of this vector.
        Specified by:
        getLengthSquared in interface Vector3D<Vector3i,​Point3i>
        Returns:
        the squared length of this vector
      • add

        public void add​(Vector3D<?,​?> vector1,
                        Vector3D<?,​?> vector2)
        Description copied from interface: Vector3D
        Sets the value of this tuple to the sum of tuples t1 and t2.
        Specified by:
        add in interface Vector3D<Vector3i,​Point3i>
        Parameters:
        vector1 - the first tuple
        vector2 - the second tuple
      • add

        public void add​(Vector3D<?,​?> vector)
        Description copied from interface: Vector3D
        Sets the value of this tuple to the sum of itself and t1.
        Specified by:
        add in interface Vector3D<Vector3i,​Point3i>
        Parameters:
        vector - the other tuple
      • scaleAdd

        public void scaleAdd​(int scale,
                             Vector3D<?,​?> vector1,
                             Vector3D<?,​?> vector2)
        Description copied from interface: Vector3D
        Sets the value of this tuple to the scalar multiplication of tuple t1 plus tuple t2 (this = s*t1 + t2).
        Specified by:
        scaleAdd in interface Vector3D<Vector3i,​Point3i>
        Parameters:
        scale - the scalar value
        vector1 - the tuple to be multipled
        vector2 - the tuple to be added
      • scaleAdd

        public void scaleAdd​(double scale,
                             Vector3D<?,​?> vector1,
                             Vector3D<?,​?> vector2)
        Description copied from interface: Vector3D
        Sets the value of this tuple to the scalar multiplication of tuple t1 plus tuple t2 (this = s*t1 + t2).
        Specified by:
        scaleAdd in interface Vector3D<Vector3i,​Point3i>
        Parameters:
        scale - the scalar value
        vector1 - the tuple to be multipled
        vector2 - the tuple to be added
      • scaleAdd

        public void scaleAdd​(int scale,
                             Vector3D<?,​?> vector)
        Description copied from interface: Vector3D
        Sets the value of this tuple to the scalar multiplication of itself and then adds tuple t1 (this = s*this + t1).
        Specified by:
        scaleAdd in interface Vector3D<Vector3i,​Point3i>
        Parameters:
        scale - the scalar value
        vector - the tuple to be added
      • scaleAdd

        public void scaleAdd​(double scale,
                             Vector3D<?,​?> vector)
        Description copied from interface: Vector3D
        Sets the value of this tuple to the scalar multiplication of itself and then adds tuple t1 (this = s*this + t1).
        Specified by:
        scaleAdd in interface Vector3D<Vector3i,​Point3i>
        Parameters:
        scale - the scalar value
        vector - the tuple to be added
      • sub

        public void sub​(Vector3D<?,​?> vector1,
                        Vector3D<?,​?> vector2)
        Description copied from interface: Vector3D
        Sets the value of this tuple to the difference of tuples t1 and t2 (this = t1 - t2).
        Specified by:
        sub in interface Vector3D<Vector3i,​Point3i>
        Parameters:
        vector1 - the first tuple
        vector2 - the second tuple
      • sub

        public void sub​(Point3D<?,​?> point1,
                        Point3D<?,​?> point2)
        Description copied from interface: Vector3D
        Sets the value of this tuple to the difference of tuples t1 and t2 (this = t1 - t2).
        Specified by:
        sub in interface Vector3D<Vector3i,​Point3i>
        Parameters:
        point1 - the first tuple
        point2 - the second tuple
      • sub

        public void sub​(Vector3D<?,​?> vector)
        Description copied from interface: Vector3D
        Sets the value of this tuple to the difference of itself and t1 (this = this - t1).
        Specified by:
        sub in interface Vector3D<Vector3i,​Point3i>
        Parameters:
        vector - the other tuple
      • setLength

        public void setLength​(double newLength)
        Description copied from interface: Vector3D
        Change the length of the vector. The direction of the vector is unchanged.
        Specified by:
        setLength in interface Vector3D<Vector3i,​Point3i>
        Parameters:
        newLength - - the new length.