If you live in the northern hemisphere, Wednesday is the summer solstice – the longest day of the year. In London, the sun will rise at 04:43 and then creep across the sky for 16 hours, 38 minutes and 18 seconds before setting at 21:21. For some cultures, the solstice is seen as the beginning of the summer, while others think of it more as midsummer. It is marked with celebrations across the northern hemisphere, most famously at Stonehenge.

Traditionally, such revels were conducted in skyclad fashion. But these days turning up starkers at an English heritage site is probably not the best course of action. Not that I object to the odd bit of pagan revelry, but for me the summer solstice is the anniversary of one of the greatest achievements of the human mind: it marks the day we first calculated the size of the Earth.

This spectacular feat took place not in the modern technological age, but way back, over 2000 years ago, in the time of the classical Greeks.

Eratosthenes of Cyrene was the chief librarian at the great library of Alexandria in the third century BC. So the story goes, he read in one of the library’s many manuscripts an account of the sun being directly overhead on the summer solstice as seen from Syene (now Aswan, Egypt). This was known because the shadows disappeared at noon, when the sun was directly overhead. This sparked his curiosity and he set out to make the same observation in Alexandria. On the next solstice, he watched as the shadows grew small – but did not disappear, even at noon.

The length of the shadows in Alexandria indicated that the sun was seven degrees away from being directly overhead. Eratosthenes realised that the only way for the shadow to disappear at Syene but not at Alexandria was if the Earth’s surface was curved. Since a full circle contains 360 degrees, it meant that Syene and Alexandria were roughly one fiftieth of the Earth’s circumference away from each other.

Knowing that Syene is roughly 5000 stadia away from Alexandria, Eratosthenes calculated that the circumference of the Earth was about 250,000 stadia. In modern distance measurements, that’s about 44,000km – which is remarkably close to today’s measurement of 40,075km.

I first heard the story when it was told by Carl Sagan in his masterpiece TV series, Cosmos. I still marvel at Eratosthenes’s achievement – a stunning piece of deduction, based only on a few simple observations and an ocean of clear thinking.

Eratosthenes also calculated that the tilt of the Earth’s polar axis (23.5 degrees) is why we have the solstice in the first place. Astronomically, the northern hemisphere’s summer solstice marks the day when Earth’s north pole is most pointed towards the sun, making the sun appear to rise earlier, set later and climb to its highest point in the sky.

The further north you go, the longer the period of daylight you experience. By the time you reach the Artic circle, the sun is above the horizon all day and night, giving rise to the so-called “midnight sun” phenomenon.

The winter solstice – the shortest day of the northern year – takes place around 21 December, when the north pole is inclined away from the sun. We in the north experience the winter solstice as the southern hemisphere gets its summer equivalent.

So on Wednesday, by all means take your clothes off and dance in the golden rays of dawn. But in the midst of your merriment, think about Eratosthenes’ achievement and the power of rational thought. That too is something to celebrate.

Stuart Clark is the author of Is There Life on Mars? (Quercus). He will be delivering the Guardian masterclass on Is there life beyond Earth?