The chronometer is a very accurate, portable clock. There were the satnavs of the 18th century!
Navigation at sea requires you to know, quite accurately, your position on the Earth's surface:
Once you lose sight of land, all you have to go on are the things you can measure - the angle of the sun and the stars in the sky, and the direction of the magnetic north pole. At least, that was true before we had satellite navigation.
Unfortunately, to find your longitude you need to know the exact time. Before the chronometer, sailors could only guess, and might be wrong by hundreds of miles. With a chronometer, the error was reduced to a few miles.
As the Earth rotates on its axis each day, most of the stars change their position in the sky. The pole star, by chance, happens to be more or less in line with the Earth's axis of rotation, so it always appears in the same place in the sky.
By measuring the angle between the horizon and the pole star, it is possible to determine you latitude - how far north or south you are. Actually this only works in the northern hemisphere, but there were other methods for calculating latitude in the southern hemisphere (for example, the angle of the sun at noon).
Calculating your longitude (how far you are west of London), is also easy in principle. Here is a view looking down on the North Pole:
The sun is directly above London (specifically the Greenwich observatory) at midday.
If you find that the sun is directly above your ship at 4 pm, it means that the Earth has rotated one sixth of a turn since the sun was over London (4 hours out of a 24 hour day is one sixth), so you must be 60 degrees west of London.
The only problem is, wherever your ship happens to be, you need to know exactly what time it is in London.
Up until the early 1700s, the only accurate mechanical clocks where based on the pendulum (like an old fashioned grandfather clock). For obvious reasons, this did not work well on a ship out on the stormy seas.
Navigation was difficult as there was no method to accurately determine longitude, but ships were needed for highly lucrative international trade. The need was so great that in 1715 the British Government offered a prize of £20,000 to anyone who could design an accurate chronometer. That is several million pounds in today's money!
It was not until 50 years later, and after a lifetime's work, that John Harrison submitted a successful design, the H4:
It is just a clock, but the sophisticated internal design meant that it was accurate to better than a second per day despite the motion and temperature variations it was subjected to on board ship. Even by modern standard, that is impressive for a purely mechanical device.
It is really a simple computer which counts "ticks", and converts them into hours, minutes and seconds. Here is what it might look like in code:
hours = 0 minutes = 0 seconds = 0 while True: wait_for_tick() seconds += 1 if seconds>=60: seconds = 0 minutes += 1 if minutes>=60: minutes = 0 hours += 1 if hours>=12: hours = 0
Copyright (c) Axlesoft Ltd 2020