Here's how he did it:
* Observation: Eratosthenes noticed that on the summer solstice, the sun shone directly down a well in Syene (modern Aswan, Egypt), meaning the sun was directly overhead. At the same time, in Alexandria, the sun was about 7 degrees off of the zenith.
* Geometry: Eratosthenes understood that the difference in the angle of the sun was due to the curvature of the Earth. He knew the distance between Alexandria and Syene (about 5,000 stadia).
* Calculation: Using basic geometry, he calculated the circumference of the Earth to be about 250,000 stadia. This translates to approximately 24,662 miles, which is remarkably close to the modern value of 24,901 miles.
While Eratosthenes' method was ingenious, it wasn't perfectly accurate due to the uncertainty of the distance between the cities and the measurement of the angle. Still, his calculation was a groundbreaking achievement and a major milestone in the history of science.