Atom-pair formulation of the rotational and vibrational motions of molecules