A compass is a device which has the basic function of displaying a bearing for navigation. The first compasses, known to have been used by Norsemen at least 1000 years ago, and quite possibly earlier by the Chinese, were magnetic, which point to the magnetic North (or South) pole rather than the geographic poles, which are not the same point. Reliable magnetic compasses, however, are more a feature of the late 19th and early 20th century. While the difference between the two may be minor at equatorial and low latitudes, the difference can become severe as one moves to higher latitudes.
Several types of electronic compasses exist, of which most, but not all, types, will point to the true rather than the magnetic pole, but have other disadvantages. A magnetic compass is self-contained, while the electronic compasses need a source of power. Magnetic compasses can be hand-made with extremely simple materials, while the various types of electronic compasses are complex and can be expensive. The electronic compasses are interpreted or read in much the same manner as a magnetic compass (although they may have a digital readout with only letters and numbers) but operate on a different principle.
Electronic approaches do require reliable electrical power, and the multiple receiver method involves a bit more complexity in installation and cable maintenance. However, while the electronic methods are far more accurate, a wise navigator will always keep a magnetic compass as a backup.
Contrary to common belief, having an extremely accurate position reference, such as the Global Positioning System (GPS), is not a complete solution for all navigation. Magnetic compasses, and some displays for certain types of electronic compass, are physically mounted so that the user can look across the compass display, possibly with a telescope, and take a bearing on a point of interest. This is not practical when the only information from the GPS is a set of coordinates, or even a point on an electronic chart display.
The magnetic compass
A magnetic compass is a simple device that has a small magnet mounted on a near frictionless spindle or needle. Typically the body of a compass is constructed of metal or strong plastic. A compass such as a “ Brunton” compass has a built in sighting clinometer and bull’s-eye level.
Using a magnetic compass
When a compass is held level, its needle will seek magnetic North from its location. This is because effect of the Earth’s magnetic field on the small magnet in the needle. The 'North-seeking' end of a compass is generally indicated in white although colours may vary, or it may simply have an N for North. A compass bearing is the geographic direction from one point to another and is generally known as the cardinal direction - which is noted in writing as a degree from this cardinal direction using first the capital letter designating North (N), South (S), East (E) or West (W), next the degree bearing and the next cardinal direction nearest the needle bearing as in N 20 E (read as North 20 degrees East) . An alternative way of stating this same bearing is through the use of the azimuth scale, which uses the face of the compass as a 360 degree circle with readings from 0 degrees to 359 degrees. Thus the bearing N 20 E would be stated as 20 in an azimuth scale and a reading of N 20 W would be read as 340 in an azimuth scale.
When sighting with a compass, it is critical to hold the compass level, centring the bubble in the bullseye level . Hold the compass at waist level. For compasses with no mirror rotate the bezel until North is in line with the direction of the travel arrow. Rotate the levelled compass on a vertical axis until the direction of travel arrow is pointing along the desired line of bearing. Check the compass level and read the bearing indicated by the North-seeking end of the needle (the North-seeking end of a compass is typically white although this may vary from compass to compass) . The bearing indicated is the bearing sighted along the line of the direction of travel arrow. In more sophisticated compasses that are equipped with a mirror, level the compass as above and adjust the mirror in the lid of the compass until the sighting tip and point sighted both appear in the mirror. Rotate the compass on a vertical axis until the sighting tip and the point sighted meet with the axial line of the mirror. The bearing indicated by the North-seeking tip is the bearing to the point sighted.
Adjusting bearing for magnetic declination
The problem of variation between magnetic and true bearing was Declination is the difference between magnetic North and true North. It was recognized in the 17th century, but practical correction for it waited until Lord Kelvin's techniques in the 1840s. 
Magnetic declination at ones location may be noted from the legend of almost any topographic map of an area and would usually be indicated in both text and with an illustration showing a pair of directional arrows forming a measurable angle. As local magnetic declination changes or "drifts" over time, estimated change is usually also given. For accurate readings it is therefore wise to use as recent a map as is possible. A typical declination reading in the legend of a map might be stated as "Mean magnetic declination 20 00’ West of True North (Jan. 1974). Mean annual change 3’ Eastwards (1970 – 1975)." Declination is adjusted for by adjusting the graduated compass circle the amount and direction of the local declination. In most compasses you simply turn the graduated circle on the outer ring of the compass. In the Brunton-type compass, declination is adjusted by means of a screw on the side of the compass. In the case of the example given above, for a reading taken in 1974 the graduated circle would be moved until the index pin located at the base of the sighting arm points to 20 on the side of the graduated circle marked with a W.
Magnetic fields of other objects and their affect on a compass
Magnetic compass readings taken near a metallic object or an object containing large amounts of metal, such as a belt-buckle, pocket knife, a car or reinforced concrete, may be wildly inaccurate,  as steel and iron items such as these have there own magnetic fields and can cause magnetic irregularities or anomalies. Magnetic anomalies may also be caused by certain features in nature, iron-bearing rocks or rocks containing magnetic material for example. Natural magnetic anomalies may be indicated when a foresight and back-sight on widely separated sighted points do not agree. Electronic devices that create magnetic fields or devices that contain magnets will also affect readings.
Gyrocompasses were a major advance over magnetic compasses.They have the advantage of not being affected by magnetic metal or power cables. They also point to true north rather than magnetic north. They became a practical necessity with the advent of iron and steel ships. While the gyroscope was invented in 1852, practical electical gyrocompasses became practical in the early 20th century.
They may get confused about rotation and lose the bearing if they are traveling quickly from east to west. Gyrocompasses also need electrical power. Since mechanical gyrocompasses have moving parts, they are the most likely kind of compass to need maintenance. Mechanical gyrocompasses are gradually being replaced by fluxgate compasses and ring laser gyrocompases. 
They do not sense the magnetic field of the earth, but rather the earth's rotation. A system of a self-stabilizing spinning wheel and weights provide a reference that is parallel to the meridian.
For pure bearing, fluxgate compasses are state of the art. While they are usually gimbal-mounted to neutralize the effect of tilt, fluxgate compasses have no magnets or moving parts involved in finding a bearing. Since it is based on electromagnets, it requires a source of power, which can be quite small.
Gyrocompasses and fluxgate compasses work very nicely in combination, since they can correct one another's sources of error. Of the two, a fluxgate compass is cheaper simpler, and can be corrected with GPS information Finally, they can send bearings to other navigational instruments, such as a chartplotter or radar, far more easily than other alternatives.
Deriving bearing from precision position
There are two ways to get current bearing information from a GPS. One requires a single receiver but is more prone to error, while the more accurate method requires two or more receivers coupled to a computer
Calculating bearing from serial position fixes
The first needs a single GPS coupled with software, perhaps in a chartplotter, that looks at a set of position fixes and "draws" the bearing line that connects them in a straight line. An obvious problem is when the observer is maneuvering fast enough that a single straight line won't run through all the fixes. A similar problem exists when the platform carrying the GPS is stopped or barely moving.
While a number of commercial chartplotters will display a software-synthesized compass display derived from a set of bearings, the manufacturers warn against relying on it for course.
The other way to get current bearing information takes advantage of the much more precise positions known from GPS accuracy improvements such as Differential GPS (DGPS) or Wide Area Augmentation System (WAAS), which can determine your position within less than 3 feet/1 meter.
With two or three GPS receivers, each with their own antenna, that are further apart than the inaccuracy of position -- antennas 10' apart for 3' accuracy, for example -- they have enough separation that a bearing line can be constructed when their computer draws a line through their individual position fixes.
The computer part of such a commercially available "GPS compass" doesn't have to wait for boat movement to get a series of fixes through which it can draw a bearing line. It always has the fixes instantaneously available, with known distances between them.
Having a course bearing coming continuously into a computerized plotter helps validates a visual relative bearing on something, such as a likely fishing spot or a hazard, which needs to be recorded. If reporting a vessel in distress, the search and rescue organization needs as many bearings as possible.
- Bowditch, Nathaniel (2002 Centennial Edition), American Practical Navigator: an epitome of navigation, National Geospatial-Intelligence Agency (formerly National Imagery and Mapping Agency) pp. 2-3
- L.R. Berger (2005). Working and Guiding in the Cradle of Humankind. Prime Origins.
- R.C. Barker and P.R. Wolf (1984). Elementary Surveying. Harper and Row.
- Bowditch, p. 3
- Bowditch, p. 3
- Bowditch, p. 93
- Stanford University GPS Laboratory, Wide Area Differential GPS (WADGPS)
- Bowditch, pp. 170-172
- National Space-Based Positioning, Navigation, and Timing Coordination Office/U.S. Coast Guard Navigation Center, GPS Augmentations