Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext
distance (with strategy)

Calculate the distance of two geometries using the specified strategy.

Description

The free function area calculates the area of a geometry. using the specified strategy. Reasons to specify a strategy include: use another coordinate system for calculations; construct the strategy beforehand (e.g. with the radius of the Earth); select a strategy when there are more than one available for a calculation.

Synopsis

template<typename Geometry1, typename Geometry2, typename Strategy>
distance_result<Geometry1, Geometry2, Strategy>::type distance(Geometry1 const & geometry1, Geometry2 const & geometry2, Strategy const & strategy)

Parameters

Type

Concept

Name

Description

Geometry1 const &

Any type fulfilling a Geometry Concept

geometry1

A model of the specified concept

Geometry2 const &

Any type fulfilling a Geometry Concept

geometry2

A model of the specified concept

Strategy const &

Any type fulfilling a Distance Strategy Concept

strategy

The strategy which will be used for distance calculations

Returns

The calculated distance

Header

Either

#include <boost/geometry.hpp>

Or

#include <boost/geometry/algorithms/distance.hpp>

Available Strategies

PrevUpHomeNext