Previous topic

9. Scoring Functions

This Page

10. Core Modules : Vector

class Vector.Vector(x, y, z)[source]

A class representing Cartesian 3-dimensonal vectors.

arg(vector)[source]

Return the argument (angle) between this and another vector.

copy()[source]

Return copy of Vector instance

cross(vector)[source]

Return a Vector instance of the cross product of this and another vector.

dist(vector)[source]
dot(vector)[source]

Return the dot product of this and another vector.

matrix_transform(rot_mat)[source]

Return Vector instance transformed using a 3x3 matrix rot_mat = a 3x3 Python matrix instance.

mod()[source]

Return the modulus (length) of the vector.

reverse()[source]

Return a Vector instance of the reverse of the vector (ie. Vector*-1).

times(factor)[source]

Return a Vector instance of the vector multiplied by a scalar factor.

to_atom()[source]
translate(x, y, z)[source]

Return Vector instance of translated vector. x, y, z = distance in Angstroms in respective Cartesian directions to translate vector.

unit()[source]

Return a Vector instance of a normalised unit vector.

Vector.altTorsion(a, b, c)[source]

An alternate and better way to find the torsion angle between planes ab and bc. a,b,c = Vector instances.

Vector.axis_angle_to_euler(x, y, z, turn, rad=False)[source]

Returns a euler form of an axis angle rotation. x, y, z = axis of rotation (does not need to be normalised). turn = angle of rotation, in radians if rad=True, else in degrees.

Vector.axis_angle_to_matrix(x, y, z, turn, rad=False)[source]

Returns a matrix form of an axis angle rotation. x, y, z = axis of rotation (does not need to be normalised). turn = angle of rotation, in radians if rad=True, else in degrees.

Vector.euler_to_matrix(x_turn, y_turn, z_turn, rad=False)[source]

Returns a matrix form of a euler rotation. x_turn, y_turn, z_turn = rotation angles around respective axis, in radians if rad=True, else in degrees.

Vector.random_vector(min_v, max_v)[source]
Vector.torsion(a, b, c)[source]

Find the torsion angle between planes ab and bc. a,b,c = Vector instances.