The study of the size and shape of earth is known as geodesy and has been practiced for centuries. Contrary to common misconceptions, many historical mathematicians and scientists were aware that Earth was spherical. Technically Earth's shape is called "Geoid", an ellipsoidal shape. Possibly starting with Eratosthenes, over 2,200 years ago, mathematicians have attempted to calculate the size of a spherical or ellipsoidal Earth. The techniques of Eratosthenes and his predecessors are considered elementary, or at least straightforward, for today's mathematician, but are impressive for their scope in calculating the entire Earth without being able to see or measure most of it and for their accuracy.
One of the oldest and still most useful applications of mathematics is using geometric relationships to derive the dimensions of things without directly measuring them. About 2000 years ago, an Ancient Greek scholar, philosopher, poet, and mathematician named Eratosthenes used staggeringly simple geometry to calculate the size of the Earth with very high accuracy. The Ancient Greeks were remarkable for their ability to use geometry to describe the scale of things that they could not directly perceive. Their geometry was always correct and clever, but their conclusions were often way off. (Due to inaccuracies in the measurements that the calculations were based off of.) The scale of the Earth is one measurement that they might have got pretty close.
Eratosthenes of Alexandria (276-195 BC) was born in Cyrene (modern Libya), studied in Athens, and became the head librarian at the Library of Alexandria. The Library of Alexandria was the center of knowledge in the Hellenic world. Learned men of the Ancient world were not fettered with specializations. Eratosthenes first gained fame as a poet, invented the first system of latitude and longitude, calculated the tilt of the earths axis, invented the discipline of geography, developed an algorithm for calculating prime numbers, and was the first person to attempt an accurate map of the world based off of physical data. Supposedly, his colleagues nick-named him \( \beta \), because he was reputed to be at least second best in the world at just about everything.
The map above was assembled from land surveys and celestial observations conducted during the time of the conquests of Alexander the Great. It covers an extremely large portion of the Earth, despite when it was created. Much of the information in the map was probably passed from word of mouth and through the compilation of many observations, made by many people, over a long period of time. It also does a relatively impressive job of portraying the rough shapes and directions, of land masses, oceans, and rivers.
From his map, it can be concluded that Eratosthenes had no first, second, or third hand knowledge about an entire hemisphere of the earth, and most of Asia and Africa. Despite this, using simple geometry, he was able to deduce the size of the earth, and hence the amount of the planet that was unknown to him.
He observed that on noon on the summer solstice of the northern hemisphere, at two different places, the sun’s rays fell upon the earth at different angles. In the city of ancient Syene (modern Aswan, Egypt), at noon on the solstice, the sun was directly overhead and cast no shadows on the objects below it (Aswan is very near the Tropic of Cancer. This was proven by observing that the Sun completely illuminated the bottom of a very deep well in Syene at noon. The angle between the suns rays, and objects perpendicular to the earths surface was effectively zero.
In Alexandria, on that same day at noon, the sun cast slight shadows behind objects. By measuring the dimensions of the shadows and the objects that cast them. Eratosthenes was able to calculate that the Sun’s rays arrived in Alexandria at an angle “\(1/50\)th” of a circle( about \(0.13\) radians or \(7.2\) degrees). He knew the distance between Alexandria and Syene to be \(5000\) “stades”, from land surveys done between the two cities. A stade was an Ancient Greek unit of measurement (\(150-200\) meters). He also assumed that Syene was due south of Alexandria and on the same meridian of longitude. This would mean that the distance between the two cities represented an arc of the earths circumference (In reality, Aswan is about three degrees of longitude east of Alexandria).
Eratosthenes assumed that the Sun was far enough away from the Earth that its rays arrived at the Earth parallel to each other. In the diagram above, \( \angle A\) is the angle that the Sun’s rays arrived to Earth at Alexandria on noon of the solstice. \( \angle B\) represents the angle subtended at the Earth’s center by the arc representing the distance between Alexandria and Syene. From the equivalence of alternate interior angles across a line transverse to two parallel lines, \( \angle A = \angle B = 1/50 \) of a circle. Since angle B is \(1/50\)th of a circle and sweeps an arc at the earth’s surface of 5,000 stades, the Earth’s circumference would be \( 5,000\times 50 = 250,000\) stades.
Because there is a scholarly debate as to what the definition of a “stade” is, there is no way of knowing exactly how close Eratosthenes was to today's currently accepted value for the circumference of the earth. It is thought that a “stade” is defined as the length of an Ancient Greek stadium used for athletic competitions. Most of them are about \(1/10\)th of a mile, but some are longer and some are shorter. There is evidence that the word stade meant different things in different contexts, at different times, and in different places. It is not certain which definition of stade Eratosthenes used. The actual circumference of the Earth is \(40,075\) km at the equator.
Regardless, he calculated the size of the earth to within an order of magnitude, and possibly got very close. He also may have been lucky. Errors could have arisen from: a) the fact that Syene and Alexandria are not exactly on the same meridian of longitude; b) significant errors in measuring the distance overland between Alexandria and Syene; or c) in measuring the angles cast by the shadows at Alexandria.
It is a common modern misconception to assume that past civilizations believed in a flat earth of unknown dimensions. Eratosthenes's calculation proliferated far and wide and was preserved by successive generations, and geographically disparate civilizations. This estimate of the size of the earth and its method, would remain canonical for the educated elite of the future civilizations of Europe, North Africa, the Middle East, and South Asia till the 17th century, when more precise measurements could be made to constrain the size of the earth.
Aryabhata Aryabhata was an Indian mathematician who lived from 476 to 550 AD and accurately wrote of the Earth as being spherical. He also estimated the circumference of the Earth to within 67 miles of modern measurements, off only by approximately 0.27%. 
Abu Arrayhan Muhammad ibn Ahmad al-Biruni A Persion mathemeatician who lived from 973 to 1048 AD, Al-Biruni used triangulation to measure the Earth. His estimate was that the Earth had a radius of 6,339.6 km, which is 16.8 km less, also approximately 0.27% off from modern measurements. 
Robert Helmert In 1906, the German geodesist Friedrich Robert Helmert determined that the Earth was a global ellipsoid and calculated it to within 100 meters, 0.002% of modern measurements.
- O'Connor, J., & Roberston, E. Aryabhata the Elder. Retrieved March 23, 2016, from http://www-groups.dcs.st-and.ac.uk/~history/Biographies/Aryabhata_I.html
- O'Connor, J., & Roberston, E. Abu Arrayhan Muhammad ibn Ahmad al-Biruni. Retrieved March 23, 2016, from http://www-groups.dcs.st-and.ac.uk/~history/Biographies/Al-Biruni.html