#### Technicals

# Distance Calculation

Historically, there have been many different ways to calculate the distance between two points on earth. Each of these methods depends on a picture of what the earth looks like.

Many ancient cultures believed the earth to be of disk shape up until some thousand years ago.

To calculate the distance between two points on a disk, we would need two dimensions of a **cylindrical coordinate system**. A point of the surface could then be expressed by his angle and radius with respect to the central point of the disk. The distance formula would then only depend on the two radii and angles.

Although there are many more or less convincing arguments for it, at WeGlide we don't believe in the theory of a flat earth anymore.

Meteorology tells us that most of the weather systems we observe would not work on a flat disk. Also, glider pilots who have enjoyed wave flights to higher altitudes haven taken photos that also indicate signs of earths curvature.

The most convincing argument against a flat earth is visible on every good gliding day in Germany. If the earth would not rotate and the sun would not rise in the east, Bayreuth and the Erzgebirge in Eastern Germany would not be such a good place to catch the first thermal of the day.

So - we should all agree, the earth is rotating and of a somewhat spherical shape.

If we regard the earth to be a perfect sphere, the shortest distance between two points would be the great-circle distance. Given the latitude and longitude of two points, their distance can be determined by the **haversine** formula. It is widely used in navigation and is a special case of a more general formula in spherical trigonometry.

But, as with most things in life, things are not that easy. The earth is not a perfect sphere but rather an **oblate spheroid**. The difference of the two axis is around 21 kilometers.

The most widely used formula to calculate the distance between to points on the surface of the spheroid is called **Vincenty's formulae. **It is much more complicated and slower than the **haversine** formula. It is iterative rather than analytic, meaning that many rounds of calculation are needed. But also, it is more accurate then the great-circle distance (to within 0.5 mm), whereas **haversine** can be off by up to 0.5 percent.

## Implications for gliding

WeGlide calculates all distances by Vincenty's formula. This is also the way SeeYou calculates distances, so when planning a flight with SeeYou, the distance should match the one in WeGlide. We hope to end the days of believing to have achieved some distance at landing up until finding out there are a couple of hundred meters missing.

It turns out that by using the Ellipsoid model of the earth, the actual distances achieved in Europe most often increase by 0.1 to 0.2 percent. In the case of a thousand kilometer flight, this amounts to a distance of 2 kilometers.

Take this flight by Raphael Teardowski for example, he wouldn't have broken the 1000km without Vincenty*.*

But sadly, the gain in distance does not apply to the entire world. Pilots flying in Namibia or South Africa may have noticed that their distances on WeGlide are somewhat lower than the distances displayed by other platforms.

While we would love to grant the additional kilometers, we will stick to the most precise distance formula and encourage pilots in Africa to just fly a bit faster.

For triangles, the scored distance can be off by a lot more. If the distance of the shortest leg is just a bit shorter, the triangle may not conform to FAI triangle rules anymore. Ultimately, the difference in scoring distance betweens a triangle calculated with haversine and a triangle calculated with Vincenty's Formula is not limited.