• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1[/============================================================================
2  Boost.Geometry (aka GGL, Generic Geometry Library)
3
4  Copyright (c) 2007-2013 Barend Gehrels, Amsterdam, the Netherlands.
5  Copyright (c) 2008-2013 Bruno Lalande, Paris, France.
6  Copyright (c) 2009-2013 Mateusz Loskot, London, UK.
7
8  Use, modification and distribution is subject to the Boost Software License,
9  Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
10  http://www.boost.org/LICENSE_1_0.txt)
11=============================================================================/]
12
13
14[/ Generated by doxygen_xml2qbk 1.1.1, don't change, will be overwritten automatically]
15[/ Generated from doxy/doxygen_output/xml/group__centroid.xml]
16[section:centroid_3_with_strategy centroid (with strategy)]
17
18'''<indexterm><primary>centroid</primary></indexterm>'''
19Calculates the centroid of a geometry using the specified strategy.
20
21[heading Description]
22The free function centroid calculates the geometric center (or: center of mass) of a geometry. 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.
23
24[heading Synopsis]
25``template<typename Geometry, typename Point, typename Strategy>
26void centroid(Geometry const & geometry, Point & c, Strategy const & strategy)``
27
28[heading Parameters]
29
30[table
31[[Type] [Concept] [Name] [Description] ]
32[[Geometry const &] [Any type fulfilling a Geometry Concept ] [geometry] [A model of the specified concept ]]
33[[Point &] [Any type fulfilling a Point Concept ] [c] [A model of the specified Point Concept which is set to the centroid ]]
34[[Strategy const &] [Any type fulfilling a Centroid Strategy Concept ] [strategy] [The strategy which will be used for centroid calculations]]
35]
36
37
38[heading Header]
39Either
40
41`#include <boost/geometry.hpp>`
42
43
44Or
45
46`#include <boost/geometry/algorithms/centroid.hpp>`
47
48[include reference/algorithms/centroid.qbk]
49[include reference/algorithms/centroid_strategies.qbk]
50
51
52[endsect]
53
54[section:centroid_2 centroid]
55
56'''<indexterm><primary>centroid</primary></indexterm>'''
57Calculates the centroid of a geometry.
58
59[heading Description]
60The free function centroid calculates the geometric center (or: center of mass) of a geometry. It uses the default strategy, based on the coordinate system of the geometry.
61
62[heading Synopsis]
63``template<typename Geometry, typename Point>
64void centroid(Geometry const & geometry, Point & c)``
65
66[heading Parameters]
67
68[table
69[[Type] [Concept] [Name] [Description] ]
70[[Geometry const &] [Any type fulfilling a Geometry Concept ] [geometry] [A model of the specified concept ]]
71[[Point &] [Any type fulfilling a Point Concept ] [c] [The calculated centroid will be assigned to this point reference]]
72]
73
74
75[heading Header]
76Either
77
78`#include <boost/geometry.hpp>`
79
80
81Or
82
83`#include <boost/geometry/algorithms/centroid.hpp>`
84
85[include reference/algorithms/centroid.qbk]
86[heading Example]
87[centroid]
88[centroid_output]
89
90
91[endsect]
92
93[section:return_centroid_1 return_centroid]
94
95'''<indexterm><primary>return_centroid</primary></indexterm>'''
96Calculates the centroid of a geometry.
97
98[heading Description]
99The free function centroid calculates the geometric center (or: center of mass) of a geometry. This version with the return\u005f prefix returns the centroid, and a template parameter must therefore be specified in the call..
100
101[heading Synopsis]
102``template<typename Point, typename Geometry>
103Point return_centroid(Geometry const & geometry)``
104
105[heading Parameters]
106
107[table
108[[Type] [Concept] [Name] [Description] ]
109[[Point] [Any type fulfilling a Point Concept ] [ - ] [Must be specified]]
110[[Geometry const &] [Any type fulfilling a Geometry Concept ] [geometry] [A model of the specified concept ]]
111]
112
113
114[heading Returns]
115The calculated centroid
116
117[heading Header]
118Either
119
120`#include <boost/geometry.hpp>`
121
122
123Or
124
125`#include <boost/geometry/algorithms/centroid.hpp>`
126
127[include reference/algorithms/centroid.qbk]
128
129
130[endsect]
131
132[section:return_centroid_2_with_strategy return_centroid (with strategy)]
133
134'''<indexterm><primary>return_centroid</primary></indexterm>'''
135Calculates the centroid of a geometry using the specified strategy.
136
137[heading Description]
138The free function centroid calculates the geometric center (or: center of mass) of a geometry. This version with the return\u005f prefix returns the centroid, and a template parameter must therefore be specified in the call.. 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.
139
140[heading Synopsis]
141``template<typename Point, typename Geometry, typename Strategy>
142Point return_centroid(Geometry const & geometry, Strategy const & strategy)``
143
144[heading Parameters]
145
146[table
147[[Type] [Concept] [Name] [Description] ]
148[[Point] [Any type fulfilling a Point Concept ] [ - ] [Must be specified]]
149[[Geometry const &] [Any type fulfilling a Geometry Concept ] [geometry] [A model of the specified concept ]]
150[[Strategy const &] [Any type fulfilling a centroid Strategy Concept ] [strategy] [The strategy which will be used for centroid calculations ]]
151]
152
153
154[heading Returns]
155The calculated centroid
156
157[heading Header]
158Either
159
160`#include <boost/geometry.hpp>`
161
162
163Or
164
165`#include <boost/geometry/algorithms/centroid.hpp>`
166
167[include reference/algorithms/centroid.qbk]
168[include reference/algorithms/centroid_strategies.qbk]
169
170
171[endsect]
172
173