3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>centroid (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="../centroid.html" title="centroid">
9 <link rel="prev" href="../centroid.html" title="centroid">
10 <link rel="next" href="centroid_2.html" title="centroid">
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="../centroid.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../centroid.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="centroid_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.centroid.centroid_3_with_strategy"></a><a class="link" href="centroid_3_with_strategy.html" title="centroid (with strategy)">centroid
29 </h5></div></div></div>
31 <a class="indexterm" name="idm46187007563120"></a>
32 Calculates the centroid of a geometry using the specified strategy.
35 <a name="geometry.reference.algorithms.centroid.centroid_3_with_strategy.h0"></a>
36 <span class="phrase"><a name="geometry.reference.algorithms.centroid.centroid_3_with_strategy.description"></a></span><a class="link" href="centroid_3_with_strategy.html#geometry.reference.algorithms.centroid.centroid_3_with_strategy.description">Description</a>
39 The free function centroid calculates the geometric center (or: center
40 of mass) of a geometry. Reasons to specify a strategy include: use another
41 coordinate system for calculations; construct the strategy beforehand
42 (e.g. with the radius of the Earth); select a strategy when there are
43 more than one available for a calculation.
46 <a name="geometry.reference.algorithms.centroid.centroid_3_with_strategy.h1"></a>
47 <span class="phrase"><a name="geometry.reference.algorithms.centroid.centroid_3_with_strategy.synopsis"></a></span><a class="link" href="centroid_3_with_strategy.html#geometry.reference.algorithms.centroid.centroid_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">Geometry</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Point</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Strategy</span><span class="special">></span>
52 <span class="keyword">void</span> <span class="identifier">centroid</span><span class="special">(</span><span class="identifier">Geometry</span> <span class="keyword">const</span> <span class="special">&</span> <span class="identifier">geometry</span><span class="special">,</span> <span class="identifier">Point</span> <span class="special">&</span> <span class="identifier">c</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.centroid.centroid_3_with_strategy.h2"></a>
57 <span class="phrase"><a name="geometry.reference.algorithms.centroid.centroid_3_with_strategy.parameters"></a></span><a class="link" href="centroid_3_with_strategy.html#geometry.reference.algorithms.centroid.centroid_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
119 Any type fulfilling a Point Concept
129 A model of the specified Point Concept which is set to the
142 Any type fulfilling a Centroid Strategy Concept
152 The strategy which will be used for centroid calculations
159 <a name="geometry.reference.algorithms.centroid.centroid_3_with_strategy.h3"></a>
160 <span class="phrase"><a name="geometry.reference.algorithms.centroid.centroid_3_with_strategy.header"></a></span><a class="link" href="centroid_3_with_strategy.html#geometry.reference.algorithms.centroid.centroid_3_with_strategy.header">Header</a>
166 <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>
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">algorithms</span><span class="special">/</span><span class="identifier">centroid</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
175 <a name="geometry.reference.algorithms.centroid.centroid_3_with_strategy.h4"></a>
176 <span class="phrase"><a name="geometry.reference.algorithms.centroid.centroid_3_with_strategy.conformance"></a></span><a class="link" href="centroid_3_with_strategy.html#geometry.reference.algorithms.centroid.centroid_3_with_strategy.conformance">Conformance</a>
179 The function centroid implements function Centroid from the <a href="http://www.opengeospatial.org/standards/sfa" target="_top">OGC
180 Simple Feature Specification</a>.
183 <a name="geometry.reference.algorithms.centroid.centroid_3_with_strategy.h5"></a>
184 <span class="phrase"><a name="geometry.reference.algorithms.centroid.centroid_3_with_strategy.behavior"></a></span><a class="link" href="centroid_3_with_strategy.html#geometry.reference.algorithms.centroid.centroid_3_with_strategy.behavior">Behavior</a>
186 <div class="informaltable"><table class="table">
212 Returns the point itself as the centroid
224 Calculates centroid (based on average)
231 linear (e.g. linestring)
236 Calculates centroid (based on weighted length)
255 Empty (e.g. polygon without points)
260 Throws a <a class="link" href="../../exceptions/centroid_exception.html" title="centroid_exception">centroid_exception</a>
284 Calculates the centroid as if based on Cartesian coordinates
291 <a name="geometry.reference.algorithms.centroid.centroid_3_with_strategy.h6"></a>
292 <span class="phrase"><a name="geometry.reference.algorithms.centroid.centroid_3_with_strategy.supported_geometries"></a></span><a class="link" href="centroid_3_with_strategy.html#geometry.reference.algorithms.centroid.centroid_3_with_strategy.supported_geometries">Supported
295 <div class="informaltable"><table class="table">
324 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span>
329 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span>
341 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span>
346 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span>
358 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span>
363 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span>
375 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span>
380 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span>
392 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span>
397 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span>
409 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span>
414 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span>
426 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span>
431 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span>
443 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span>
448 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span>
460 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span>
465 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span>
472 <a name="geometry.reference.algorithms.centroid.centroid_3_with_strategy.h7"></a>
473 <span class="phrase"><a name="geometry.reference.algorithms.centroid.centroid_3_with_strategy.complexity"></a></span><a class="link" href="centroid_3_with_strategy.html#geometry.reference.algorithms.centroid.centroid_3_with_strategy.complexity">Complexity</a>
479 <a name="geometry.reference.algorithms.centroid.centroid_3_with_strategy.h8"></a>
480 <span class="phrase"><a name="geometry.reference.algorithms.centroid.centroid_3_with_strategy.available_strategies"></a></span><a class="link" href="centroid_3_with_strategy.html#geometry.reference.algorithms.centroid.centroid_3_with_strategy.available_strategies">Available
483 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
484 <a class="link" href="../../strategies/strategy_centroid_bashein_detmer.html" title="strategy::centroid::bashein_detmer">Bashein
485 Detmer (cartesian)</a>
488 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
489 <td align="left"></td>
490 <td align="right"><div class="copyright-footer">Copyright © 2009-2019 Barend Gehrels, Bruno Lalande, Mateusz Loskot, Adam
491 Wulkiewicz, Oracle and/or its affiliates<p>
492 Distributed under the Boost Software License, Version 1.0. (See accompanying
493 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>)
498 <div class="spirit-nav">
499 <a accesskey="p" href="../centroid.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../centroid.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="centroid_2.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>