libquat: a simple library for quaternion rotation