added helper functions that convert between quirk quaternions and matlab quaternions