ANGLE
 This is part of the colvar module

Calculate an angle.

This command can be used to compute the angle between three atoms. Alternatively if four atoms appear in the atom specification it calculates the angle between two vectors identified by two pairs of atoms.

If three atoms are given, the angle is defined as:

$\theta=\arccos\left(\frac{ {\bf r}_{21}\cdot {\bf r}_{23}}{ |{\bf r}_{21}| |{\bf r}_{23}|}\right)$

Here $${\bf r}_{ij}$$ is the distance vector among the $$i$$th and the $$j$$th listed atom.

If four atoms are given, the angle is defined as:

$\theta=\arccos\left(\frac{ {\bf r}_{21}\cdot {\bf r}_{34}}{ |{\bf r}_{21}| |{\bf r}_{34}|}\right)$

Notice that angles defined in this way are non-periodic variables and their value is limited by definition between 0 and $$\pi$$.

The vectors $${\bf r}_{ij}$$ are by default evaluated taking periodic boundary conditions into account. This behavior can be changed with the NOPBC flag.

Examples

This command tells plumed to calculate the angle between the vector connecting atom 1 to atom 2 and the vector connecting atom 2 to atom 3 and to print it on file COLVAR1. At the same time, the angle between vector connecting atom 1 to atom 2 and the vector connecting atom 3 to atom 4 is printed on file COLVAR2.

Click on the labels of the actions for more information on what each action computes
a: ANGLE ATOMSthe list of atoms involved in this collective variable (either 3 or 4 atoms). =1,2,3
# equivalently one could state:
# a: ANGLE ATOMS=1,2,2,3
b: ANGLE ATOMSthe list of atoms involved in this collective variable (either 3 or 4 atoms). =1,2,3,4
PRINT ARGthe input for this action is the scalar output from one or more other actions. =a FILEthe name of the file on which to output these quantities =COLVAR1
PRINT ARGthe input for this action is the scalar output from one or more other actions. =b FILEthe name of the file on which to output these quantities =COLVAR2

Glossary of keywords and components
The atoms involved can be specified using
 ATOMS the list of atoms involved in this collective variable (either 3 or 4 atoms). For more information on how to specify lists of atoms see Groups and Virtual Atoms
Options
 NUMERICAL_DERIVATIVES ( default=off ) calculate the derivatives for these quantities numerically NOPBC ( default=off ) ignore the periodic boundary conditions when calculating distances