boost::geometry::strategy::distance::haversine
distance_haversine.hpp
boost::geometry::strategy::distance::haversine::calculation_type
typename RadiusType RadiusType
typename CalculationType CalculationType void
comparable::haversine< RadiusType, CalculationType > typedef comparable::haversine<RadiusType, CalculationType> boost::geometry::strategy::distance::haversine< RadiusType, CalculationType >::comparable_type comparable_type
RadiusType typedef RadiusType boost::geometry::strategy::distance::haversine< RadiusType, CalculationType >::radius_type radius_type
RadiusType RadiusType boost::geometry::strategy::distance::haversine< RadiusType, CalculationType >::m_radius m_radius
typename Point1
typename Point2
calculation_type< Point1, Point2 >::type calculation_type<Point1, Point2>::type boost::geometry::strategy::distance::haversine< RadiusType, CalculationType >::apply (Point1 const &p1, Point2 const &p2) const apply Point1 const & p1 Point2 const & p2

applies the distance calculation

the calculated distance (including multiplying with radius)

p1

first point

p2

second point

boost::geometry::strategy::distance::haversine< RadiusType, CalculationType >::haversine
(RadiusType const &radius=1.0)
haversine
RadiusType const & radius 1.0

Constructor.

radius

radius of the sphere, defaults to 1.0 for the unit sphere

RadiusType RadiusType boost::geometry::strategy::distance::haversine< RadiusType, CalculationType >::radius () const radius

access to radius value

the radius

Distance calculation for spherical coordinates on a perfect sphere using haversine.

RadiusType

numeric type for radius (of sphere, earth)

CalculationType

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

Adapted from: http://williams.best.vwh.net/avform.htm

http://en.wikipedia.org/wiki/Great-circle_distance

(from Wiki:) The great circle distance d between two points with coordinates {lat1,lon1} and {lat2,lon2} is given by: d=acos(sin(lat1)*sin(lat2)+cos(lat1)*cos(lat2)*cos(lon1-lon2)) A mathematically equivalent formula, which is less subject to rounding error for short distances is: d=2*asin(sqrt((sin((lat1-lat2) / 2))^2 + cos(lat1)*cos(lat2)*(sin((lon1-lon2) / 2))^2))

[heading See also] [link geometry.reference.algorithms.distance.distance_3_with_strategy distance (with strategy)]
- boost::geometry::strategy::distance::haversine
  apply
- boost::geometry::strategy::distance::haversine
  comparable_type
- boost::geometry::strategy::distance::haversine
  haversine
- boost::geometry::strategy::distance::haversine
  m_radius
- boost::geometry::strategy::distance::haversine
  radius
- boost::geometry::strategy::distance::haversine
  radius_type