1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>comparable_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="../distance.html" title="distance"> 10<link rel="next" href="comparable_distance_2.html" title="comparable_distance"> 11</head> 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> 20</tr></table> 21<hr> 22<div class="spirit-nav"> 23<a accesskey="p" href="../distance.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="comparable_distance_2.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a> 24</div> 25<div class="section"> 26<div class="titlepage"><div><div><h5 class="title"> 27<a name="geometry.reference.algorithms.distance.comparable_distance_3_with_strategy"></a><a class="link" href="comparable_distance_3_with_strategy.html" title="comparable_distance (with strategy)">comparable_distance 28 (with strategy)</a> 29</h5></div></div></div> 30<p> 31 <a class="indexterm" name="idm45635699628032"></a> 32Calculate the comparable distance measurement of two geometries using 33 the specified strategy. 34 </p> 35<h6> 36<a name="geometry.reference.algorithms.distance.comparable_distance_3_with_strategy.h0"></a> 37 <span class="phrase"><a name="geometry.reference.algorithms.distance.comparable_distance_3_with_strategy.description"></a></span><a class="link" href="comparable_distance_3_with_strategy.html#geometry.reference.algorithms.distance.comparable_distance_3_with_strategy.description">Description</a> 38 </h6> 39<p> 40 The free function comparable_distance does not necessarily calculate 41 the distance, but it calculates a distance measure such that two distances 42 are comparable to each other. For example: for the Cartesian coordinate 43 system, Pythagoras is used but the square root is not taken, which makes 44 it faster and the results of two point pairs can still be compared to 45 each other. 46 </p> 47<h6> 48<a name="geometry.reference.algorithms.distance.comparable_distance_3_with_strategy.h1"></a> 49 <span class="phrase"><a name="geometry.reference.algorithms.distance.comparable_distance_3_with_strategy.synopsis"></a></span><a class="link" href="comparable_distance_3_with_strategy.html#geometry.reference.algorithms.distance.comparable_distance_3_with_strategy.synopsis">Synopsis</a> 50 </h6> 51<p> 52</p> 53<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> 54<span class="identifier">comparable_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">comparable_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> 55<p> 56 </p> 57<h6> 58<a name="geometry.reference.algorithms.distance.comparable_distance_3_with_strategy.h2"></a> 59 <span class="phrase"><a name="geometry.reference.algorithms.distance.comparable_distance_3_with_strategy.parameters"></a></span><a class="link" href="comparable_distance_3_with_strategy.html#geometry.reference.algorithms.distance.comparable_distance_3_with_strategy.parameters">Parameters</a> 60 </h6> 61<div class="informaltable"><table class="table"> 62<colgroup> 63<col> 64<col> 65<col> 66<col> 67</colgroup> 68<thead><tr> 69<th> 70 <p> 71 Type 72 </p> 73 </th> 74<th> 75 <p> 76 Concept 77 </p> 78 </th> 79<th> 80 <p> 81 Name 82 </p> 83 </th> 84<th> 85 <p> 86 Description 87 </p> 88 </th> 89</tr></thead> 90<tbody> 91<tr> 92<td> 93 <p> 94 Geometry1 const & 95 </p> 96 </td> 97<td> 98 <p> 99 first geometry type 100 </p> 101 </td> 102<td> 103 <p> 104 geometry1 105 </p> 106 </td> 107<td> 108 <p> 109 A model of the specified concept 110 </p> 111 </td> 112</tr> 113<tr> 114<td> 115 <p> 116 Geometry2 const & 117 </p> 118 </td> 119<td> 120 <p> 121 second geometry type 122 </p> 123 </td> 124<td> 125 <p> 126 geometry2 127 </p> 128 </td> 129<td> 130 <p> 131 A model of the specified concept 132 </p> 133 </td> 134</tr> 135<tr> 136<td> 137 <p> 138 Strategy const & 139 </p> 140 </td> 141<td> 142 <p> 143 Any type fulfilling a Distance Strategy Concept 144 </p> 145 </td> 146<td> 147 <p> 148 strategy 149 </p> 150 </td> 151<td> 152 <p> 153 The strategy which will be used for distance calculations 154 </p> 155 </td> 156</tr> 157</tbody> 158</table></div> 159<h6> 160<a name="geometry.reference.algorithms.distance.comparable_distance_3_with_strategy.h3"></a> 161 <span class="phrase"><a name="geometry.reference.algorithms.distance.comparable_distance_3_with_strategy.returns"></a></span><a class="link" href="comparable_distance_3_with_strategy.html#geometry.reference.algorithms.distance.comparable_distance_3_with_strategy.returns">Returns</a> 162 </h6> 163<p> 164 The calculated comparable distance 165 </p> 166<h6> 167<a name="geometry.reference.algorithms.distance.comparable_distance_3_with_strategy.h4"></a> 168 <span class="phrase"><a name="geometry.reference.algorithms.distance.comparable_distance_3_with_strategy.header"></a></span><a class="link" href="comparable_distance_3_with_strategy.html#geometry.reference.algorithms.distance.comparable_distance_3_with_strategy.header">Header</a> 169 </h6> 170<p> 171 Either 172 </p> 173<p> 174 <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> 175 </p> 176<p> 177 Or 178 </p> 179<p> 180 <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">comparable_distance</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code> 181 </p> 182</div> 183<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 184<td align="left"></td> 185<td align="right"><div class="copyright-footer">Copyright © 2009-2019 Barend Gehrels, Bruno Lalande, Mateusz Loskot, Adam 186 Wulkiewicz, Oracle and/or its affiliates<p> 187 Distributed under the Boost Software License, Version 1.0. (See accompanying 188 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>) 189 </p> 190</div></td> 191</tr></table> 192<hr> 193<div class="spirit-nav"> 194<a accesskey="p" href="../distance.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="comparable_distance_2.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a> 195</div> 196</body> 197</html> 198