inertial measurement unit (IMU)
An IMU is a single chip that packs an accelerometer and a gyroscope together — usually three axes of each, giving '6-axis' motion sensing (add a 3-axis magnetometer/compass and it becomes '9-axis'). The idea is to bottle up everything needed to answer 'how am I moving and which way am I pointing?' in one fingernail-sized part. The accelerometer feels linear pushes and gravity; the gyroscope feels rotation; together they capture the full freedom of a rigid body tumbling through space. This is the same sensing principle that guided rockets and submarines for decades — now reduced from a refrigerator-sized, million-dollar gimballed platform to a $3 chip in every phone, drone, and game controller.
An IMU on its own does not magically know its position — its real job is to feed a sensor-fusion algorithm. The gyroscope gives crisp short-term rotation but drifts; the accelerometer gives a drift-free 'down' vector but is noisy and confused by motion. A complementary or Kalman filter blends them so each covers the other's weakness, outputting a stable orientation (often as a quaternion). Trying to also get position by double-integrating acceleration is the holy grail and the heartbreak of IMUs: the errors grow with the square of time, so pure 'inertial navigation' from a cheap IMU drifts metres within seconds — which is why phones still need GPS to anchor the absolute position.
Marketing 'axis counts' are just the sum of sensor channels: 6-axis = 3 accel + 3 gyro; 9-axis adds a 3-axis magnetometer; '10-axis' usually folds in a barometer for altitude. More axes don't mean better accuracy — a 9-axis IMU with a poor magnetometer can read worse heading than a well-calibrated 6-axis plus external compass.