ffe.lang
Class AtomUtils

java.lang.Object
  extended byffe.lang.AtomUtils

public final class AtomUtils
extends java.lang.Object

The AtomUtils class is a simple math library that operates on 3-coordinate vectors. The main design objectives were speed and no memory consumption.


Field Summary
static float BUFF
          Length in Angstroms that is added to Atomic Radii when determining if two Atoms are within bonding distance
static javax.vecmath.Color3f[] colorlist
           
static java.util.Hashtable colorlookup
          Colors for display routines
static int DOUBLEBOND
          Bonding Character
static int SINGLEBOND
          Bonding Character
static int SP
          Atomic Bonding Hybridization
static int SP2
          Atomic Bonding Hybridization
static int SP3
          Atomic Bonding Hybridization
static int TRIPLEBOND
          Bonding Character
 
Constructor Summary
AtomUtils()
           
 
Method Summary
static double angle(double[] i, double[] j)
           
static float angle(float[] i, float[] j)
           
static double bondangle(double[] i, double[] j, double[] k)
          Finds the angle formed by three atoms
static float bondangle(float[] i, float[] j, float[] k)
          Finds the angle formed by three atoms
static void cross(double[] a, double[] b, double[] ret)
          Finds the cross-product between two vectors
static void cross(float[] a, float[] b, float[] ret)
          Finds the cross-product between two vectors
static void diff(double[] a, double[] b, double[] ret)
          Finds the difference between two vectors
static void diff(float[] a, float[] b, float[] ret)
          Finds the difference between two vectors
static double dihedralangle(double[] a, double[] b, double[] c, double[] d)
          Finds the dihedral angle formed between 4 atoms
static float dihedralangle(float[] a, float[] b, float[] c, float[] d)
          Finds the dihedral angle formed between 4 atoms
static double dist(double[] a, double[] b)
          Finds the distance between two vectors
static float dist(float[] a, float[] b)
          Finds the distance between two vectors
static double dot(double[] a, double[] b)
          Finds the dot product between two vectors
static float dot(float[] a, float[] b)
          Finds the dot product between two vectors
static void norm(double[] n, double[] ret)
          Normalizes a vector
static void norm(float[] n, float[] ret)
          Normalizes a vector
static void printVector(double[] v)
           
static double r(double[] d)
          Finds the length of a vector
static float r(float[] d)
          Finds the length of a vector
static void scalar(double[] n, double a, double[] ret)
          Scales a vector
static void scalar(float[] n, float a, float[] ret)
          Scales a vector
static void sum(double[] a, double[] b, double[] ret)
           
static void sum(float[] a, float[] b, float[] ret)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUFF

public static final float BUFF
Length in Angstroms that is added to Atomic Radii when determining if two Atoms are within bonding distance

See Also:
Constant Field Values

SP

public static final int SP
Atomic Bonding Hybridization

See Also:
Constant Field Values

SP2

public static final int SP2
Atomic Bonding Hybridization

See Also:
Constant Field Values

SP3

public static final int SP3
Atomic Bonding Hybridization

See Also:
Constant Field Values

SINGLEBOND

public static final int SINGLEBOND
Bonding Character

See Also:
Constant Field Values

DOUBLEBOND

public static final int DOUBLEBOND
Bonding Character

See Also:
Constant Field Values

TRIPLEBOND

public static final int TRIPLEBOND
Bonding Character

See Also:
Constant Field Values

colorlookup

public static final java.util.Hashtable colorlookup
Colors for display routines


colorlist

public static final javax.vecmath.Color3f[] colorlist
Constructor Detail

AtomUtils

public AtomUtils()
Method Detail

r

public static float r(float[] d)
Finds the length of a vector

Parameters:
d - A vector to find the length of.
Returns:
Length of vector d.

norm

public static void norm(float[] n,
                        float[] ret)
Normalizes a vector

Parameters:
n - A vector to be normalized.
Returns:
Normalized vector.

scalar

public static void scalar(float[] n,
                          float a,
                          float[] ret)
Scales a vector

Parameters:
n - A vector to be scaled
a - A scaler value
Returns:
Vector n scaled by a

dist

public static float dist(float[] a,
                         float[] b)
Finds the distance between two vectors

Parameters:
a - First vector
b - Second vector

diff

public static void diff(float[] a,
                        float[] b,
                        float[] ret)
Finds the difference between two vectors

Parameters:
a - First vector
b - Second vector
ret - Return Values

sum

public static void sum(float[] a,
                       float[] b,
                       float[] ret)

dot

public static float dot(float[] a,
                        float[] b)
Finds the dot product between two vectors

Parameters:
a - First vector
b - Second vector
Returns:
The dot product of a and b

cross

public static void cross(float[] a,
                         float[] b,
                         float[] ret)
Finds the cross-product between two vectors

Parameters:
a - First vector
b - Second vector
ret - The cross-product a x b

bondangle

public static float bondangle(float[] i,
                              float[] j,
                              float[] k)
Finds the angle formed by three atoms

Parameters:
i - Atom position vector
j - Atom position vector (central atom)
k - Atom position vector
Returns:
The angle in the range [ -pi, pi ]

angle

public static float angle(float[] i,
                          float[] j)

dihedralangle

public static float dihedralangle(float[] a,
                                  float[] b,
                                  float[] c,
                                  float[] d)
Finds the dihedral angle formed between 4 atoms

Parameters:
a - Atom position vector
b - Atom position vector
c - Atom position vector
d - Atom position vector
Returns:
The dihedral angle in the range [ -pi, pi ]

r

public static double r(double[] d)
Finds the length of a vector

Parameters:
d - A vector to find the length of.
Returns:
Length of vector d.

norm

public static void norm(double[] n,
                        double[] ret)
Normalizes a vector

Parameters:
n - A vector to be normalized.
Returns:
Normalized vector.

scalar

public static void scalar(double[] n,
                          double a,
                          double[] ret)
Scales a vector

Parameters:
n - A vector to be scaled
a - A scaler value
Returns:
Vector n scaled by a

dist

public static double dist(double[] a,
                          double[] b)
Finds the distance between two vectors

Parameters:
a - First vector
b - Second vector

diff

public static void diff(double[] a,
                        double[] b,
                        double[] ret)
Finds the difference between two vectors

Parameters:
a - First vector
b - Second vector
ret - Return Values

sum

public static void sum(double[] a,
                       double[] b,
                       double[] ret)

dot

public static double dot(double[] a,
                         double[] b)
Finds the dot product between two vectors

Parameters:
a - First vector
b - Second vector
Returns:
The dot product of a and b

cross

public static void cross(double[] a,
                         double[] b,
                         double[] ret)
Finds the cross-product between two vectors

Parameters:
a - First vector
b - Second vector
ret - The cross-product a x b

bondangle

public static double bondangle(double[] i,
                               double[] j,
                               double[] k)
Finds the angle formed by three atoms

Parameters:
i - Atom position vector
j - Atom position vector (central atom)
k - Atom position vector
Returns:
The angle in the range [ -pi, pi ]

angle

public static double angle(double[] i,
                           double[] j)

printVector

public static void printVector(double[] v)

dihedralangle

public static double dihedralangle(double[] a,
                                   double[] b,
                                   double[] c,
                                   double[] d)
Finds the dihedral angle formed between 4 atoms

Parameters:
a - Atom position vector
b - Atom position vector
c - Atom position vector
d - Atom position vector
Returns:
The dihedral angle in the range [ -pi, pi ]