The dipole-dipole potential in statistical mechanics