[frames] | no frames]

# Module Vector'

source code

Vector class, including rotation-related functions.
 Classes
Vector
3D vector.
 Functions

 calc_angle(v1, v2, v3) Calculate angle method. source code

 calc_dihedral(v1, v2, v3, v4) Calculate dihedral angle method. 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 left multiplying rotation matrix. source code

 rotaxis2m(theta, vector) Calculate left multiplying rotation matrix. source code

 rotmat(p, q) Return a (left multiplying) matrix that rotates p onto q. source code

 vector_to_axis(line, point) Vector to axis method. source code
 Variables
__package__ = `'Bio.PDB'`
 Function Details

### calc_angle(v1, v2, v3)

source code

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

### calc_dihedral(v1, v2, v3, v4)

source code

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}

### m2rotaxis(m)

source code

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.

### 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 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.

### rotaxis2m(theta, vector)

source code

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.

### 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

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

 Generated by Epydoc 3.0.1 on Mon Jul 10 15:14:14 2017 http://epydoc.sourceforge.net