Rosetta
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
coordlib Namespace Reference

Functions

def toDeg
 
def toRad
 
def dist_sq
 
def dist
 
def coord_angle
 
def torsion
 
def makeVector
 
def vabs
 
def vunit
 
def vmult
 
def vadd
 
def vavg
 
def rss
 
def dot
 
def cross
 
def stp
 
def vangle
 

Function Documentation

def coordlib.coord_angle (   atom1,
  atom2,
  atom3 
)
A = [xA, yA, zA], and B and C are defined in the same fashion.  Given
these 3 coordinates, returns the angle between the AB and BC bond vectors.

Definition at line 20 of file coordlib.py.

References makeVector(), toDeg(), and vangle().

def coordlib.cross (   v1,
  v2 
)
cross(v1, v2) - returns the cross product of two vectors
   This function evaluates the cross product between two cartesian
   vectors in 3d.  For v1 = [x1, y1, z1], v2 = [x2, y2, z2], and
   cartesian unit vectors i, j, and k, this is defined as the
   determinant of the following matrix:

   | i   j   k  |
   | x1  y1  z1 |
   | x2  y2  z2 |

   More simply,

   cross([x1, y1, z1], [x2, y2, z2]) ==>
     [y1*z2 - z1*y2, z1*x2 - x1*z2, x1*y2 - y1*x2]

   It can also be shown that

--       |cross(v1, v2)| == |v1| * |v2| * sin(theta)

   Where theta is the angle between the two vectors.

Definition at line 115 of file coordlib.py.

Referenced by stp(), and torsion().

def coordlib.dist (   atom1,
  atom2 
)
def coordlib.dist_sq (   atom1,
  atom2 
)
def coordlib.dot (   v1,
  v2 
)
dot(v1, v2) - return the inner (dot) product of two vectors
   This function evaluates the dot product between two vectors, defined
   as the following:

   dot([x1, y1, z1], [x2, y2, z2]) ==> x1*x2 + y1*y2 + z1*z2

   It can be shown that this is also equal to:

   dot(v1, v2) ==> |v1| * |v2| * cos(theta)

   Where theta is the angle between the vectors.

Definition at line 100 of file coordlib.py.

Referenced by stp(), and vangle().

def coordlib.makeVector (   atom1,
  atom2 
)
vector(atom1, atom2) - return the mathematical vector from A to B
   Given two points, A and B, this function returns the vector going
   from point A to point B, represented as a list of cartesian
   components.  A and be must be lists of coordinates in x, y, and
   z.  That is:

   vector([x1, y1, z1], [x2, y2, z2]) ==> [x2-x1, y2-y1, z2-z1]

Definition at line 43 of file coordlib.py.

Referenced by coord_angle(), and torsion().

def coordlib.rss (   v1,
  v2 
)
gets the root sum of squares for two vectors (the distance
between)

Definition at line 90 of file coordlib.py.

References ObjexxFCL.len().

def coordlib.stp (   v1,
  v2,
  v3 
)
stp(v1, v2, v3) - return the scalar triple product of three vectors
   This function will return the scalar triple product of three vectors,
   defined most simply as dot(v3, cross(v1, v2)).  It can be shown that
   |stp(v1, v2, v3)| is the volume of the parallelpiped with sides
   defined by the vectors.  It follows that the following relationships
   apply:
 
   stp(v1, v2, v3) == stp(v2, v3, v1) == stp(v3, v1, v2)

Definition at line 141 of file coordlib.py.

References cross(), and dot().

Referenced by torsion().

def coordlib.toDeg (   ang)
toDeg(ang) - converts an angle in radians to an angle in degrees

Definition at line 4 of file coordlib.py.

Referenced by coord_angle(), and torsion().

def coordlib.toRad (   ang)
toRad(ang) - converts an angle in degrees to an angle in radians

Definition at line 8 of file coordlib.py.

def coordlib.torsion (   A,
  B,
  C,
  D 
)

Definition at line 29 of file coordlib.py.

References cross(), makeVector(), stp(), toDeg(), and vangle().

def coordlib.vabs (   vec)
vabs(vec) - return the absolute value of a given vector
   The absolute value of a three-dimensional vector from point A to
   point B is defined as the distance between points A and B.  This
   function evaluates that value for a vector as defined above.

Definition at line 54 of file coordlib.py.

Referenced by vangle(), and vunit().

def coordlib.vadd (   v1,
  v2 
)

Definition at line 73 of file coordlib.py.

References ObjexxFCL.len().

Referenced by vavg().

def coordlib.vangle (   v1,
  v2 
)
vangle(v1, v2) - returns the angle (in radians) between two vectors
   If v1 and v2 are two vectors, this function uses the cosine
   relationship given above (in dot) to determine the angle between
   those vectors when one vector is projected on the plane of the other.
   Note that this value can only be the range of the arccos function,
   so theta will be in the range 0 to Pi.

Definition at line 153 of file coordlib.py.

References dot(), and vabs().

Referenced by coord_angle(), and torsion().

def coordlib.vavg (   vlist)

Definition at line 80 of file coordlib.py.

References ObjexxFCL.len(), vadd(), and vmult().

Referenced by loadPDB.calcCAcentroid(), and loadPDB.getCentroid().

def coordlib.vmult (   vec,
  n 
)

Definition at line 66 of file coordlib.py.

Referenced by vavg(), and vunit().

def coordlib.vunit (   vec)

Definition at line 62 of file coordlib.py.

References vabs(), and vmult().