Spherical Trigonometry and Geodetic Distance
Calculating distances and bearings on Earth requires spherical trigonometry because the Earth is roughly spherical. The shortest distance between two points on a sphere is a great-circle distance.
To calculate this, we use the Haversine formula: \(a = \sin^2\left(\frac{\Delta \phi}{2}\right) + \cos(\phi_1)\cos(\phi_2)\sin^2\left(\frac{\Delta \lambda}{2}\right)\), and \(c = 2\text{ atan2}(\sqrt{a}, \sqrt{1-a})\), where \(\phi\) is latitude, \(\lambda\) is longitude in radians, and \(\Delta\) represents the differences. The distance is: \(d = R \times c\), where \(R\) is Earth's mean radius (6,371,000 meters). This formula is highly accurate for geocaching purposes, with errors under 0.5%.