I had to Goole it! They use the same formula that Eratosthenes used for measuring the Radius of the Earth.
The Greek mathematician and astronomer Eratosthenes calculated this in 200 B.C.. He knew that on a particular day in Syene, the sun would be directly overhead. He set up a stick in Alexandria 5,000 stadia away (800-900 kilometres) on this day, and measured the angle of the shadow that the sun formed at midday. He measured this to be 7.2°. He deduced that this is the same angle from the Earth’s centre that the distance between the two cities represents. Since there are 360° in a circle, he worked out that 5,000 stadia is one-fiftieth of the circumference of the Earth. He therefore suggested the value of 250,000 stadia (40,000-46,000km). Astronomers recently measured it using satellite equipment and submitted the figure of 40,008 km.