compute orientation from accelerometer/magnetometer