The Enūma Anu Enlil, a series of 70 clay tablets, was found in the ruins of King Ashurbanipal’s library in Nineveh (on the eastern bank of the River Tigris, opposite modern-day Mosul in Iraq). The name means “in the days of Anu and Enlil”; Anu was the sky god, Enlil the wind god. The tablets, which date as far back as 1950 BC, list 7,000 omens from Babylonian astrology: “If the moon can be seen on the first day, the land will be happy.” But tablet 63 is different: it gives the times when Venus first became visible, or disappeared, over a 21-year period. This Venus tablet of Ammisaduqa is the earliest known record of planetary observations.

The Babylonians were expert astronomers who produced star catalogues and tables of eclipses, planetary motion and changes in the length of day. They were also capable mathematicians, with a number system much like ours, but using base 60 rather than ten. They could solve quadratic equations and calculate the diagonal of a square with precision, and they applied their mathematical skills to the heavens. In those days, mathematics and astronomy were part and parcel of astrology and religion, and the whole package was intimately bound up with agriculture through the progression of the seasons.

The torch of astronomy passed by way of ancient Greece to India. In sixth-century India, mathematics was a sub-branch of astronomy, and astronomy still played second fiddle to reading omens in the stars. The Arab world made further advances in our understanding of the cosmos, and kept the ancient knowledge alive until Europe once more turned its attentions to the science of the heavens.

In 1601 Johannes Kepler became imperial mathematician to the Holy Roman emperor Rudolf II. Casting the emperor’s horoscope paid the bills, and it also left time for serious mathematics and astronomy. Kepler had inherited accurate observations of Mars from his former master Tycho Brahe, and from these he extracted three mathematical patterns, his laws of planetary motion. By then, thanks to Nicolaus Copernicus, it was known—though still controversial, to say the least—that the planets revolve round the sun, not the Earth. Their orbits were thought to be combinations of circles, but Kepler’s calculations showed that planets move in ellipses. His other two laws govern how quickly the planet moves and how long it takes to go round the sun.

In his epic Mathematical Principles of Natural Philosophy of 1687, Isaac Newton built on Kepler’s laws and deduced his law of universal gravitation: every body in the universe attracts every other body with a force that obeys a specific mathematical rule. These forces determine how moons, planets and stars move. Newton’s book paved the way to a rational scientific understanding of nature based on precise mathematical laws, and opened up the metaphor of the clockwork universe.