next up previous contents index
Next: Function cosangle_to_line Up: Module atoms_module Previous: Function make_lattice   Contents   Index

Function centre_of_mass


\begin{boxedminipage}{\textwidth}
\begin{verbatim}CoM = centre_of_mass(at[,index_list,origin])\end{verbatim}
\end{boxedminipage}

Calculate the centre of mass of an atoms object, using the closest images to the origin atom, or first atom if this is not specified. If an index_list is present, just calculate it for that subset of atoms (then the origin atom is the first in this list unless it is specified separately).

Note: Because the origin can be specified separately it need not be one of the atoms in the calculation.

at -- type(atoms), intent(in)

index_list -- integer, dimension(:), optional, intent(in)

origin -- integer, optional, intent(in)

Return value -- real(dp), dimension(3)

cosangle_to_line function

gabor 2009-06-30