Package mmLib :: Module AtomMath
[hide private]
[frames] | no frames]

Module AtomMath

source code

Mathematical operations performed on mmLib.Strcuture.Atom objects.

Functions [hide private]
 
length(u)
Calculates the length of u.
source code
 
normalize(u)
Returns the normalized vector along u.
source code
 
cross(u, v)
Cross product of u and v: Cross[u,v] = {-u3 v2 + u2 v3, u3 v1 - u1 v3, -u2 v1 + u1 v2}
source code
 
internal_cross(u, v)
Returns the cross product of two vectors.
source code
 
internal_dot(u, v)
Returns the dot product of two vectors.
source code
 
internal_inv3x3(u)
Returns the inverse of a 3x3 matrix.
source code
 
rmatrix(alpha, beta, gamma)
Return a rotation matrix based on the Euler angles alpha, beta, and gamma in radians.
source code
 
rmatrixu(u, theta)
Return a rotation matrix caused by a right hand rotation of theta radians around vector u.
source code
 
dmatrix(alpha, beta, gamma)
Returns the displacement matrix based on rotation about Euler angles alpha, beta, and gamma.
source code
 
dmatrixu(u, theta)
Return a displacement matrix caused by a right hand rotation of theta radians around vector u.
source code
 
rmatrixz(vec)
Return a rotation matrix which transforms the coordinate system such that the vector vec is aligned along the z axis.
source code
 
rquaternionu(u, theta)
Returns a quaternion representing the right handed rotation of theta radians about vector u.
source code
 
addquaternion(q1, q2)
Adds quaternions q1 and q2.
source code
 
rmatrixquaternion(q)
Create a rotation matrix from q quaternion rotation.
source code
 
quaternionrmatrix(R)
Return a quaternion calculated from the argument rotation matrix R.
source code
 
calc_distance(a1, a2)
Returns the distance between two argument atoms.
source code
 
calc_angle(a1, a2, a3)
Return the angle between the three argument atoms.
source code
 
calc_torsion_angle_old(a1, a2, a3, a4)
Calculates the torsion angle between the four argument atoms.
source code
 
calc_torsion_angle(a1, a2, a3, a4, sqrt=<built-in function sqrt>, acos=<built-in function acos>)
Calculates the torsion angle between the four argument atoms.
source code
 
calc_CCuij(U, V)
Calculate the correlation coefficient for anisotropic ADP tensors U and V.
source code
 
calc_Suij(U, V)
Calculate the similarity of anisotropic ADP tensors U and V.
source code
 
calc_DP2uij(U, V)
Calculate the square of the volumetric difference in the probability density function of anisotropic ADP tensors U and V.
source code
 
calc_anisotropy(U)
Calculates the anisotropy of a atomic ADP tensor U.
source code
 
diff_trace_UV(U, V)
Calculates the trace difference of anisotropic ADP tensors U and V.
source code
 
sum_square_diff(U, V)
Calculates the sum of the differences of anisotropic ADP tensors U and V squared.
source code
 
calc_rosenfeld(a, b, d, U, V) source code
 
calc_atom_centroid(atom_iter)
Calculates the centroid of all contained Atom instances and returns a Vector to the centroid.
source code
 
calc_atom_mean_temp_factor(atom_iter)
Calculates the average temperature factor of all contained Atom instances and returns the average temperature factor.
source code
 
calc_inertia_tensor(atom_iter, origin)
Calculate a moment-of-inertia tensor at the given origin assuming all atoms have the same mass.
source code
 
test_module() source code
Variables [hide private]
  __package__ = 'mmLib'
Function Details [hide private]

internal_cross(u, v)

source code 

Returns the cross product of two vectors. Should be identical to the output of numpy.cross(u, v).

internal_dot(u, v)

source code 

Returns the dot product of two vectors. Should be identical to the output of numpy.dot(u, v).

internal_inv3x3(u)

source code 

Returns the inverse of a 3x3 matrix. Should be identical to the output of numpy.linalg.inv(u).

rquaternionu(u, theta)

source code 

Returns a quaternion representing the right handed rotation of theta radians about vector u. Quaternions are typed as Numeric Python numpy.arrays of length 4.

addquaternion(q1, q2)

source code 

Adds quaternions q1 and q2. Quaternions are typed as Numeric Python numpy.arrays of length 4.

rmatrixquaternion(q)

source code 

Create a rotation matrix from q quaternion rotation. Quaternions are typed as Numeric Python numpy.arrays of length 4.

calc_torsion_angle_old(a1, a2, a3, a4)

source code 

Calculates the torsion angle between the four argument atoms. Note: This "old" subroutine doesn't appear to do what it claims. Please see the 'new' calc_torsion_angle() function below.

calc_anisotropy(U)

source code 

Calculates the anisotropy of a atomic ADP tensor U. Anisotropy is defined as the smallest eigenvalue of U divided by the largest eigenvalue of U.