Package org.openscience.cdk.math
Class Vector
java.lang.Object
org.openscience.cdk.math.Vector
This class handles vectors.
- Belongs to CDK module:
- qm
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Vector
Unary vector in 3 dimensional spacestatic final Vector
Unary vector in 3 dimensional spacestatic final Vector
Unary vector in 3 dimensional spacestatic final Vector
Null vector in 3 dimensional spacefinal int
The size of this vectorfinal double[]
The content of this vector -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAddition from two vectorsCross product, only well definited in R^3double
Multiplikation from two vectorsCopy a vectorint
getSize()
Returns the size of this vectordouble
length()
Return the length from this vectormul
(double b) Multiplikation from a vectors with an doublenegate()
Negates this vectorNormalize this vectorSubtraktion from two vectorstoString()
Return a vector as a string
-
Field Details
-
NULLVECTOR
Null vector in 3 dimensional space -
EX
Unary vector in 3 dimensional space -
EY
Unary vector in 3 dimensional space -
EZ
Unary vector in 3 dimensional space -
vector
public final double[] vectorThe content of this vector -
size
public final int sizeThe 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
Addition from two vectors -
sub
Subtraktion from two vectors -
mul
Multiplikation from a vectors with an double -
dot
Multiplikation from two vectors -
cross
Cross product, only well definited in R^3 -
length
public double length()Return the length from this vector -
normalize
Normalize this vector -
negate
Negates this vector -
duplicate
Copy a vector -
toString
Return a vector as a string
-