The Greek mathematician who calculated the Earth's circumference was Eratosthenes.
Eratosthenes made his estimate in the 3rd century BC while directing the Library of Alexandria. He compared the angle of the Sun's shadow in Alexandria with observations from Syene, usually identified with modern Aswan, where the Sun was thought to shine straight down a well at noon on the summer solstice.
Using the difference in shadow angles and the measured distance between the two cities, he applied geometry to estimate the planet's full circumference. His result is commonly reported as 252,000 stadia. Depending on the exact length of the ancient stadion, that figure was remarkably close to the modern measurement.
A common mix-up is to credit Hipparchus, another major Greek astronomer, because he later refined astronomical measurements and may have influenced versions of the reported figure. Eratosthenes was also a geographer, poet, and scholar, and is often called the father of mathematical geography.