Class Vector

java.lang.Object
org.openscience.cdk.math.Vector

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

    Fields
    Modifier and Type
    Field
    Description
    static final Vector
    Unary vector in 3 dimensional space
    static final Vector
    Unary vector in 3 dimensional space
    static final Vector
    Unary vector in 3 dimensional space
    static final Vector
    Null vector in 3 dimensional space
    final int
    The size of this vector
    final double[]
    The content of this vector
  • Constructor Summary

    Constructors
    Constructor
    Description
    Vector(double[] array)
    Constructs a vector with the content of a array
    Vector(int size)
    Constructs a Vector with "size" elements
    Vector(javax.vecmath.Tuple3d t)
    Constructs a Vector with a Tuple3d, Vector3d or Point3d
  • Method Summary

    Modifier and Type
    Method
    Description
    Addition from two vectors
    Cross product, only well definited in R^3
    double
    Multiplikation from two vectors
    Copy a vector
    int
    Returns the size of this vector
    double
    Return the length from this vector
    mul(double b)
    Multiplikation from a vectors with an double
    Negates this vector
    Normalize this vector
    Subtraktion from two vectors
    Return a vector as a string

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • 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 Details

    • 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 Details

    • 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