Output rotation in quaternion format also