The longitude problem
Latitude at sea can be found by measuring the height of the sun at noon or of the pole star at night. Longitude is harder. The earth turns fifteen degrees an hour, so a difference in longitude is a difference in local time. A navigator who knows the time at a reference port and the local time at sea can calculate longitude. The difficulty was keeping accurate time on a ship for weeks on end.
Dead reckoning
Until the eighteenth century ships estimated longitude by dead reckoning, working out position from speed, heading and elapsed time. The errors accumulated. In 1707 four ships of a British fleet under Sir Cloudesley Shovell were wrecked on the Isles of Scilly after the fleet believed itself to be well to the west of them, and well over a thousand men died.
In 1714 Parliament passed the Longitude Act, which offered rewards of up to £20,000 for a method that could find longitude at sea to within half a degree.
Two approaches
Astronomers proposed measuring the angle between the moon and a chosen star, which can be compared with printed tables to give the time at Greenwich. This lunar distance method needed accurate tables and careful observation. The other approach was mechanical: a clock that kept time through changes of temperature and the motion of a ship. Pendulum clocks, the best timekeepers on land, were useless at sea.
Harrison
John Harrison, a Yorkshire carpenter and clockmaker, spent decades on the clock approach. His first sea clock, H1, was tried on a voyage to Lisbon in 1736. His fourth design, H4, looked like an oversized pocket watch and went on trial in 1761 on a voyage to Jamaica, where after 81 days it was off by about five seconds.
The Board of Longitude asked for further trials, and Harrison received his reward only in 1773, after appeals to the king and to Parliament. Meanwhile the Astronomer Royal, Nevil Maskelyne, had begun publishing the Nautical Almanac in 1766, which made the lunar distance method practical.
For about a century both methods were used. Chronometers were expensive, and a ship might carry one or two, checked against lunar observations. As they became cheaper in the nineteenth century, they became the standard way to find longitude at sea.