example code to compute pseudo dihedrals for groups of atoms in a simulation