One of the Four Great Inventions of China (alongside papermaking, gunpowder, and printing), the compass provides orientation per cardinal points: north, east, south, and west. The instrument is believed to have been conceived as a divinatory tool, but further developments made the compass a pivotal asset to navigation under the Han dynasty (206 BC-220 AD).
The compass was later adopted worldwide, and its most common present-day version is the magnetic compass. Also known as a magnetometer, the magnetic compass has a needle that aligns itself with the horizontal axis of our planet's magnetic field. When properly calibrated, the needle is pulled toward the Earth's north magnetic pole, so its other end faces the south magnetic pole.
Magnetism is no longer the only way to find cardinal orientation; the gyroscope and the GPS built into numerous electronic devices are other examples. These sensors, along with the magnetometer, may also operate together for extra precision. Moreover, most current mobile devices work with an e-compass, an electronic compass that comprises two sensors (magnetometer and accelerometer) and compensates for device tilting.