Calculate quaternion, convert to euler angle