...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Distance calculation for spherical coordinates on a perfect sphere using haversine.
template<typename Point1, typename Point2, typename CalculationType> class strategy::distance::haversine { // ... };
Parameter 
Default 
Description 

typename Point1 
point type 

typename Point2 
Point1 
second point type 
typename CalculationType 
void 
numeric type for calculation (e.g. high precision); if void then it is extracted automatically from the coordinate type and (if necessary) promoted to floating point 
Function 
Description 
Parameters 

haversine(calculation_type const & radius = 1.0)

Constructor. 
calculation_type const &: radius: radius of the sphere, defaults to 1.0 for the unit sphere 
Function 
Description 
Parameters 
Returns 

calculation_type apply(Point1 const & p1, Point2 const & p2)

applies the distance calculation 
Point1 const &: p1: first point Point2 const &: p2: second point 
the calculated distance (including multiplying with radius) 
calculation_type radius()

access to radius value 
the radius 
#include <boost/geometry/strategies/spherical/distance_haversine.hpp>