3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>distance (with strategy)</title>
5 <link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7 <link rel="home" href="../../../../index.html" title="Chapter 1. Geometry">
8 <link rel="up" href="../distance.html" title="distance">
9 <link rel="prev" href="comparable_distance_2.html" title="comparable_distance">
10 <link rel="next" href="distance_2.html" title="distance">
12 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13 <table cellpadding="2" width="100%"><tr>
14 <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../boost.png"></td>
15 <td align="center"><a href="../../../../../../../../index.html">Home</a></td>
16 <td align="center"><a href="../../../../../../../../libs/libraries.htm">Libraries</a></td>
17 <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18 <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19 <td align="center"><a href="../../../../../../../../more/index.htm">More</a></td>
22 <div class="spirit-nav">
23 <a accesskey="p" href="comparable_distance_2.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../distance.html"><img src="../../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="distance_2.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
26 <div class="titlepage"><div><div><h5 class="title">
27 <a name="geometry.reference.algorithms.distance.distance_3_with_strategy"></a><a class="link" href="distance_3_with_strategy.html" title="distance (with strategy)">distance
29 </h5></div></div></div>
31 <a class="indexterm" name="idm46187001255152"></a>
32 Calculate the distance between two geometries using the specified strategy.
35 <a name="geometry.reference.algorithms.distance.distance_3_with_strategy.h0"></a>
36 <span class="phrase"><a name="geometry.reference.algorithms.distance.distance_3_with_strategy.description"></a></span><a class="link" href="distance_3_with_strategy.html#geometry.reference.algorithms.distance.distance_3_with_strategy.description">Description</a>
39 The free function distance calculates the distance between two geometries
40 using the specified strategy. Reasons to specify a strategy include:
41 use another coordinate system for calculations; construct the strategy
42 beforehand (e.g. with the radius of the Earth); select a strategy when
43 there are more than one available for a calculation.
46 <a name="geometry.reference.algorithms.distance.distance_3_with_strategy.h1"></a>
47 <span class="phrase"><a name="geometry.reference.algorithms.distance.distance_3_with_strategy.synopsis"></a></span><a class="link" href="distance_3_with_strategy.html#geometry.reference.algorithms.distance.distance_3_with_strategy.synopsis">Synopsis</a>
51 <pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Geometry1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Geometry2</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Strategy</span><span class="special">></span>
52 <span class="identifier">distance_result</span><span class="special"><</span><span class="identifier">Geometry1</span><span class="special">,</span> <span class="identifier">Geometry2</span><span class="special">,</span> <span class="identifier">Strategy</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">distance</span><span class="special">(</span><span class="identifier">Geometry1</span> <span class="keyword">const</span> <span class="special">&</span> <span class="identifier">geometry1</span><span class="special">,</span> <span class="identifier">Geometry2</span> <span class="keyword">const</span> <span class="special">&</span> <span class="identifier">geometry2</span><span class="special">,</span> <span class="identifier">Strategy</span> <span class="keyword">const</span> <span class="special">&</span> <span class="identifier">strategy</span><span class="special">)</span></pre>
56 <a name="geometry.reference.algorithms.distance.distance_3_with_strategy.h2"></a>
57 <span class="phrase"><a name="geometry.reference.algorithms.distance.distance_3_with_strategy.parameters"></a></span><a class="link" href="distance_3_with_strategy.html#geometry.reference.algorithms.distance.distance_3_with_strategy.parameters">Parameters</a>
59 <div class="informaltable"><table class="table">
97 Any type fulfilling a Geometry Concept
107 A model of the specified concept
114 Geometry2 const &
119 Any type fulfilling a Geometry Concept
129 A model of the specified concept
141 Any type fulfilling a Distance Strategy Concept
151 The strategy which will be used for distance calculations
158 <a name="geometry.reference.algorithms.distance.distance_3_with_strategy.h3"></a>
159 <span class="phrase"><a name="geometry.reference.algorithms.distance.distance_3_with_strategy.returns"></a></span><a class="link" href="distance_3_with_strategy.html#geometry.reference.algorithms.distance.distance_3_with_strategy.returns">Returns</a>
162 The calculated distance
165 <a name="geometry.reference.algorithms.distance.distance_3_with_strategy.h4"></a>
166 <span class="phrase"><a name="geometry.reference.algorithms.distance.distance_3_with_strategy.header"></a></span><a class="link" href="distance_3_with_strategy.html#geometry.reference.algorithms.distance.distance_3_with_strategy.header">Header</a>
172 <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
178 <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">/</span><span class="identifier">algorithms</span><span class="special">/</span><span class="identifier">distance</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
181 <a name="geometry.reference.algorithms.distance.distance_3_with_strategy.h5"></a>
182 <span class="phrase"><a name="geometry.reference.algorithms.distance.distance_3_with_strategy.available_strategies"></a></span><a class="link" href="distance_3_with_strategy.html#geometry.reference.algorithms.distance.distance_3_with_strategy.available_strategies">Available
185 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
186 <li class="listitem">
187 <a class="link" href="../../strategies/strategy_distance_pythagoras.html" title="strategy::distance::pythagoras">Pythagoras
190 <li class="listitem">
191 <a class="link" href="../../strategies/strategy_distance_haversine.html" title="strategy::distance::haversine">Haversine
194 <li class="listitem">
195 <a class="link" href="../../strategies/strategy_distance_cross_track.html" title="strategy::distance::cross_track">Cross
196 track (spherical, point-to-segment)</a>
198 <li class="listitem">
199 <a class="link" href="../../strategies/strategy_distance_projected_point.html" title="strategy::distance::projected_point">Projected
200 point (cartesian, point-to-segment)</a>
202 <li class="listitem">
203 more (currently extensions): Vincenty, Andoyer (geographic)
207 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
208 <td align="left"></td>
209 <td align="right"><div class="copyright-footer">Copyright © 2009-2019 Barend Gehrels, Bruno Lalande, Mateusz Loskot, Adam
210 Wulkiewicz, Oracle and/or its affiliates<p>
211 Distributed under the Boost Software License, Version 1.0. (See accompanying
212 file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
217 <div class="spirit-nav">
218 <a accesskey="p" href="comparable_distance_2.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../distance.html"><img src="../../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="distance_2.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>