Package Bio :: Package PDB :: Module Vector'
[hide private]
[frames] | no frames]

Module Vector'

source code

Vector class, including rotation-related functions.

Classes [hide private]
  Vector
3D vector
Functions [hide private]
 
calc_angle(v1, v2, v3)
Calculate the angle between 3 vectors representing 3 connected points.
source code
 
calc_dihedral(v1, v2, v3, v4)
Calculate the dihedral angle between 4 vectors representing 4 connected points.
source code
 
m2rotaxis(m)
Return angles, axis pair that corresponds to rotation matrix m.
source code
 
refmat(p, q)
Return a (left multiplying) matrix that mirrors p onto q.
source code
 
rotaxis(theta, vector)
Calculate a left multiplying rotation matrix that rotates theta rad around vector.
source code
 
rotaxis2m(theta, vector)
Calculate a left multiplying rotation matrix that rotates theta rad around vector.
source code
 
rotmat(p, q)
Return a (left multiplying) matrix that rotates p onto q.
source code
 
vector_to_axis(line, point)
Returns the vector between a point and the closest point on a line (ie.
source code
Variables [hide private]
  __package__ = 'Bio.PDB'
Function Details [hide private]

calc_angle(v1, v2, v3)

source code 

Calculate the angle between 3 vectors
representing 3 connected points.

@param v1, v2, v3: the tree points that define the angle
@type v1, v2, v3: L{Vector}

@return: angle
@rtype: float

calc_dihedral(v1, v2, v3, v4)

source code 

Calculate the dihedral angle between 4 vectors
representing 4 connected points. The angle is in
]-pi, pi].

@param v1, v2, v3, v4: the four points that define the dihedral angle
@type v1, v2, v3, v4: L{Vector}

refmat(p, q)

source code 

Return a (left multiplying) matrix that mirrors p onto q.

Example:
    >>> mirror=refmat(p, q)
    >>> qq=p.left_multiply(mirror)
    >>> print(q)
    >>> print(qq) # q and qq should be the same

@type p,q: L{Vector}
@return: The mirror operation, a 3x3 Numeric array.

rotaxis(theta, vector)

source code 

Calculate a left multiplying rotation matrix that rotates
theta rad around vector.

Example:

    >>> m=rotaxis(pi, Vector(1, 0, 0))
    >>> rotated_vector=any_vector.left_multiply(m)

@type theta: float
@param theta: the rotation angle


@type vector: L{Vector}
@param vector: the rotation axis

@return: The rotation matrix, a 3x3 Numeric array.

rotaxis2m(theta, vector)

source code 

Calculate a left multiplying rotation matrix that rotates
theta rad around vector.

Example:

    >>> m=rotaxis(pi, Vector(1, 0, 0))
    >>> rotated_vector=any_vector.left_multiply(m)

@type theta: float
@param theta: the rotation angle


@type vector: L{Vector}
@param vector: the rotation axis

@return: The rotation matrix, a 3x3 Numeric array.

rotmat(p, q)

source code 

Return a (left multiplying) matrix that rotates p onto q.

Example:
    >>> r=rotmat(p, q)
    >>> print(q)
    >>> print(p.left_multiply(r))

@param p: moving vector
@type p: L{Vector}

@param q: fixed vector
@type q: L{Vector}

@return: rotation matrix that rotates p onto q
@rtype: 3x3 Numeric array

vector_to_axis(line, point)

source code 

Returns the vector between a point and
the closest point on a line (ie. the perpendicular
projection of the point on the line).

@type line: L{Vector}
@param line: vector defining a line

@type point: L{Vector}
@param point: vector defining the point