At one time, it was the only reliable means of direction-finding on days when the sun and stars were not visible. Nowadays, sophisticated equipment is available that enables users to determine their bearing accurately and to pinpoint locations to within a few metres. However, such equipment has not made the compass obsolete. It is still a very practical tool for navigation for many small craft and for people on foot. Even airplanes and ships equipped with more sophisticated equipment often carry compasses as backups.
Compasses come in a variety of shapes and sizes depending on their intended use.
The type of compass used on a ship or aircraft is a complex device capable of compensating for both the motion of the craft and its metallic structure. At the other extreme are small pocket compasses of low precision intended for casual use. Regardless of their intended purpose or the complexity of their construction, most compasses operate on the same basic principle. A small, elongated, permanently magnetized needle is placed on a pivot so that it may rotate freely in the horizontal plane. The Earth's magnetic field which is shaped approximately like the field around a simple bar magnet exerts forces on the compass needle, causing it to rotate until it comes to rest in the same horizontal direction as the magnetic field.