Quaternion arithmetic and Euler angles