Eratosthenes compared the position of the sun's rays in two places in order to calculate the spherical size of the earth with reasonable accuracy.
Eratosthenes learned about a famous fountain in the Egyptian city of Swenet (Greek Syene, today Aswan) on the Nile. One noon of the year, the summer solstice (between June 20 and 22), the sun's rays shone directly into the deep well and only illuminated the water at the bottom, not the sides of the well as on other days, which showed that the Sun was directly above it (Syene was very close to what we call the Tropic of Cancer, 23.5 degrees). North, the northernmost degree of latitude where the sun is always directly overhead at noon.
Eratosthenes erected a mast in Alexandria, and at the summer
solstice he observed that he was casting a shadow that shows that
the sun was not directly over his head, but The knowledge of the
curvature of the earth and the knowledge of the distance between the
two cities enabled Eratosthenes to calculate the circumference of
the planet. Eratosthenes was able to measure the angle of the sun's
rays with respect to the vertical that divides the length of the
opposite limb to the south. Angle (the length of the shadow) through
the leg next to the angle (the height of the post). This gave it an
angle of 7.12 degrees.He knew that the circumference of the earth
was a 360-degree circle, so 7.12 (or 7.2 to divide 360 evenly by
50) degrees was about one-fiftieth of the circumference. He also
knew the approximate distance between Alexandria and Siena so he
could work out this equation:
`"Angle Difference" / 360 = "Distance between cities" / "Distance
around the Earth"`
Eratosthenes estimated the distance from Alexandria to Syene to be 5,000 stadia or about 800 kilometers. He made this estimate from the time it took hikers, trained to measure distances at regular paces, between cities. In solving the equation, he calculated a circumference of 250,000 stadiums, or 25,000 miles (40,000 kilometers).
Eratosthenes’ calculations and our explanations revealed various sources of errors. As a unit of measurement, he uses the Greek unit "stadium" or the length of the stadium on the one hand. But not all stadiums are the same length. In Greece, the size of the stadium is about 185 meters (607 feet), while in Egypt, the size of the stadium is about 157.5 meters (517 feet). We don't know which unit Eratostheni uses. If you use the Greek dimension, your calculation will look like the following. If you use the Egyptian survey, your error is less than 2% of the earth’s true circumference of 40,008 kilometers.
A century later in Eratosthenes, the astronomer Posidonius (c. 135-51 BC) of Rhodes in Greece calculated the circumference of the earth. Posidonius uses the Canopus star as a reference system: if a star can be seen on the horizon of Rhode Island, then in Alexandria, it is 7.5 degrees above the horizon. His first calculation was almost accurate, but he modified the distance between Rhode Island and Alexandria, and the result was about 29,000 kilometers, which is 28% less than the actual range. Ptolemy reported Posidonius’ calculations, not Eratosthenes, and Ptolemy’s work passed to Christopher Columbus. If Ptolemy used the largest and most accurate Eratosthenes to calculate the circumference of the earth, Columbus might never sail west.
Eratosthenes lived to be approximately eighty-two years old, whilst he starved himself to death due to the fact he feared the onset of blindness.
Source Paper: https://eaae-astronomy.org/eratosthenes/