biopython v1.71.0 Bio.PDB.Vector
Vector class, including rotation-related functions.
Link to this section Summary
Functions
Calculate angle method
Calculate dihedral angle method
Return angles, axis pair that corresponds to rotation matrix m
Return a (left multiplying) matrix that mirrors p onto q
Calculate left multiplying rotation matrix
Return a (left multiplying) matrix that rotates p onto q
Vector to axis method
Link to this section Functions
Calculate angle method.
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
Calculate dihedral angle method.
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}
Return angles, axis pair that corresponds to rotation matrix m.
The case where m
is the identity matrix corresponds to a singularity where any
rotation axis is valid. In that case, Vector([1,0,0])
, is returned.
Return a (left multiplying) matrix that mirrors p onto q.
Example:
>>> mirror=refmat(p, q)
>>> qq=p.left_multiply(mirror)
>>> print(q)
>>> print(qq)
:type p,q: L{Vector} :return: The mirror operation, a 3x3 Numeric array.
Calculate left multiplying rotation matrix.
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.
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 method.
Return 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