Skip to content

angle

esta.general.angle

unit_vector(vector)

Returns the unit vector of the vector.

angle_between(v1, v2)

Returns the angle in radians between vectors 'v1' and 'v2'::

angle_between((1, 0, 0), (0, 1, 0)) 1.5707963267948966 angle_between((1, 0, 0), (1, 0, 0)) 0.0 angle_between((1, 0, 0), (-1, 0, 0)) 3.141592653589793

angle_between_atom_pairs(atm_pair1, atm_pair2, filename)

find angle between vectors corresponding to atom-pairs1 and atom-pair2.

e.g atom-pair 1,3 and atoms-pairs 5,6

atm_pair_vector1: v1 is vector from atom 1 to 3 : 1---------->3 atm_pair_vector2: v2 is vector from atom 5 6o 6 : 5---------->6

atm_pair1 = [1,3] atm_pair2 = [5,6] from a filename (xyz file) with numbering of atoms from 1

Parameters:

atm_pairs1: list list of atom-indices, e.g [1,3] atm_pairs2: list list of atom-indices, e.g [5,6] filename: str name of the xyz file

Returns:

ang: scalar angle in degree between vectors formed by the atm_pairs1 and atm_pairs2

angle_between_atoms_(atm1_index, atm2_index, atm3_index, filename)

find angle between three atoms present in the xyz file.

If there are many angle to be calculated then pass a list of list of atomic indices ... TODO .. easy to do it .. just loop over the list of atom indices

Parameters:

atm1_index: integer index for the atom1, numbering of atom from 1 atm2_index: integer index for the atom2, numbering of atom from 1 atm3_index: integer index for the atom3, numbering of atom from 1 filename: str name of the xyz file

Returns:

ang: scalar angle in degree between atoms from atom2 to atom1, and atom2 to atom3

angle_between_atoms(atms_indices_list, filename=None)

find angle between list (or list of list) containing three atoms indices present in the xyz file.

Parameters:

atms_indices_list: list list (or list of list) of three atoms indices (numbering from 1) present filename: str name of the xyz file

Returns:

ang: list of scalar list of angles in degrees label: list list of atomic symbols

dihedral_between_atoms(atms_indices_list, filename=None)

find the dihedral angle between four pts p[0:4] or list of 4 pts

.. note:: need testing .. whether to choose dihedral1 or dihedral3, initially taking dihedral1 only

Parameters:

atms_indices_list: list list (or list of list) of three atoms indices (numbering from 1) present filename: str (optional) name of the xyz file

Returns:

ang: list of scalar list of angles in degrees label: list list of atomic symbols