Class Vector


  • public class Vector
    extends Object
    This class handles vectors.
    Belongs to CDK module:
    qm
    • Field Detail

      • NULLVECTOR

        public static final Vector NULLVECTOR
        Null vector in 3 dimensional space
      • EX

        public static final Vector EX
        Unary vector in 3 dimensional space
      • EY

        public static final Vector EY
        Unary vector in 3 dimensional space
      • EZ

        public static final Vector EZ
        Unary vector in 3 dimensional space
      • vector

        public final double[] vector
        The content of this vector
      • size

        public final int size
        The size of this vector
    • Constructor Detail

      • Vector

        public Vector​(int size)
        Constructs a Vector with "size" elements
      • Vector

        public Vector​(double[] array)
        Constructs a vector with the content of a array
      • Vector

        public Vector​(javax.vecmath.Tuple3d t)
        Constructs a Vector with a Tuple3d, Vector3d or Point3d
    • Method Detail

      • getSize

        public int getSize()
        Returns the size of this vector
      • add

        public Vector add​(Vector b)
        Addition from two vectors
      • sub

        public Vector sub​(Vector b)
        Subtraktion from two vectors
      • mul

        public Vector mul​(double b)
        Multiplikation from a vectors with an double
      • dot

        public double dot​(Vector b)
        Multiplikation from two vectors
      • cross

        public Vector cross​(Vector b)
        Cross product, only well definited in R^3
      • length

        public double length()
        Return the length from this vector
      • normalize

        public Vector normalize()
        Normalize this vector
      • negate

        public Vector negate()
        Negates this vector
      • duplicate

        public Vector duplicate()
        Copy a vector
      • toString

        public String toString()
        Return a vector as a string
        Overrides:
        toString in class Object