• 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__arithmetic.xml]
16[section:add_point add_point]
17
18'''<indexterm><primary>add_point</primary></indexterm>'''
19Adds a point to another.
20
21[heading Description]
22The coordinates of the second point will be added to those of the first point. The second point is not modified.
23
24[heading Synopsis]
25``template<typename Point1, typename Point2>
26void add_point(Point1 & p1, Point2 const & p2)``
27
28[heading Parameters]
29
30[table
31[[Type] [Concept] [Name] [Description] ]
32[[Point1 &] [Any type fulfilling a Point Concept ] [p1] [first point ]]
33[[Point2 const &] [Any type fulfilling a Point Concept ] [p2] [second point ]]
34]
35
36
37[heading Header]
38Either
39
40`#include <boost/geometry.hpp>`
41
42
43Or
44
45`#include <boost/geometry/arithmetic/arithmetic.hpp>`
46
47
48[endsect]
49
50[section:add_value add_value]
51
52'''<indexterm><primary>add_value</primary></indexterm>'''
53Adds the same value to each coordinate of a point.
54
55[heading Synopsis]
56``template<typename Point>
57void add_value(Point & p, typename detail::param< Point >::type value)``
58
59[heading Parameters]
60
61[table
62[[Type] [Concept] [Name] [Description] ]
63[[Point &] [Any type fulfilling a Point Concept ] [p] [point ]]
64[[typename detail::param< Point >::type] [] [value] [value to add ]]
65]
66
67
68[heading Header]
69Either
70
71`#include <boost/geometry.hpp>`
72
73
74Or
75
76`#include <boost/geometry/arithmetic/arithmetic.hpp>`
77
78
79[endsect]
80
81[section:assign_point assign_point]
82
83'''<indexterm><primary>assign_point</primary></indexterm>'''
84Assign a point with another.
85
86[heading Description]
87The coordinates of the first point will be assigned those of the second point. The second point is not modified.
88
89[heading Synopsis]
90``template<typename Point1, typename Point2>
91void assign_point(Point1 & p1, Point2 const & p2)``
92
93[heading Parameters]
94
95[table
96[[Type] [Concept] [Name] [Description] ]
97[[Point1 &] [Any type fulfilling a Point Concept ] [p1] [first point ]]
98[[Point2 const &] [Any type fulfilling a Point Concept ] [p2] [second point ]]
99]
100
101
102[heading Header]
103Either
104
105`#include <boost/geometry.hpp>`
106
107
108Or
109
110`#include <boost/geometry/arithmetic/arithmetic.hpp>`
111
112
113[endsect]
114
115[section:assign_value assign_value]
116
117'''<indexterm><primary>assign_value</primary></indexterm>'''
118Assign each coordinate of a point the same value.
119
120[heading Synopsis]
121``template<typename Point>
122void assign_value(Point & p, typename detail::param< Point >::type value)``
123
124[heading Parameters]
125
126[table
127[[Type] [Concept] [Name] [Description] ]
128[[Point &] [Any type fulfilling a Point Concept ] [p] [point ]]
129[[typename detail::param< Point >::type] [] [value] [value to assign ]]
130]
131
132
133[heading Header]
134Either
135
136`#include <boost/geometry.hpp>`
137
138
139Or
140
141`#include <boost/geometry/arithmetic/arithmetic.hpp>`
142
143
144[endsect]
145
146[section:cross_product_2 cross_product]
147
148'''<indexterm><primary>cross_product</primary></indexterm>'''
149Computes the cross product of two vectors.
150
151[heading Description]
152All vectors should have the same dimension, 3 or 2.
153
154[heading Synopsis]
155``template<typename ResultP, typename P1, typename P2>
156ResultP cross_product(P1 const & p1, P2 const & p2)``
157
158[heading Parameters]
159
160[table
161[[Type] [Concept] [Name] [Description] ]
162[[ResultP] [] [ - ] [Must be specified]]
163[[P1 const &] [] [p1] [first vector ]]
164[[P2 const &] [] [p2] [second vector ]]
165]
166
167
168[heading Returns]
169the cross product vector
170
171[heading Header]
172`#include <boost/geometry/arithmetic/cross_product.hpp>`
173
174
175[endsect]
176
177[section:cross_product_2 cross_product]
178
179'''<indexterm><primary>cross_product</primary></indexterm>'''
180Computes the cross product of two vectors.
181
182[heading Description]
183All vectors should have the same dimension, 3 or 2.
184
185[heading Synopsis]
186``template<typename P>
187P cross_product(P const & p1, P const & p2)``
188
189[heading Parameters]
190
191[table
192[[Type] [Concept] [Name] [Description] ]
193[[P const &] [] [p1] [first vector ]]
194[[P const &] [] [p2] [second vector ]]
195]
196
197
198[heading Returns]
199the cross product vector
200
201[heading Header]
202`#include <boost/geometry/arithmetic/cross_product.hpp>`
203
204[heading Examples]
205[cross_product] [cross_product_output]
206
207
208[endsect]
209
210[section:divide_point divide_point]
211
212'''<indexterm><primary>divide_point</primary></indexterm>'''
213Divides a point by another.
214
215[heading Description]
216The coordinates of the first point will be divided by those of the second point. The second point is not modified.
217
218[heading Synopsis]
219``template<typename Point1, typename Point2>
220void divide_point(Point1 & p1, Point2 const & p2)``
221
222[heading Parameters]
223
224[table
225[[Type] [Concept] [Name] [Description] ]
226[[Point1 &] [Any type fulfilling a Point Concept ] [p1] [first point ]]
227[[Point2 const &] [Any type fulfilling a Point Concept ] [p2] [second point ]]
228]
229
230
231[heading Header]
232Either
233
234`#include <boost/geometry.hpp>`
235
236
237Or
238
239`#include <boost/geometry/arithmetic/arithmetic.hpp>`
240
241
242[endsect]
243
244[section:divide_value divide_value]
245
246'''<indexterm><primary>divide_value</primary></indexterm>'''
247Divides each coordinate of the same point by a value.
248
249[heading Synopsis]
250``template<typename Point>
251void divide_value(Point & p, typename detail::param< Point >::type value)``
252
253[heading Parameters]
254
255[table
256[[Type] [Concept] [Name] [Description] ]
257[[Point &] [Any type fulfilling a Point Concept ] [p] [point ]]
258[[typename detail::param< Point >::type] [] [value] [value to divide by ]]
259]
260
261
262[heading Header]
263Either
264
265`#include <boost/geometry.hpp>`
266
267
268Or
269
270`#include <boost/geometry/arithmetic/arithmetic.hpp>`
271
272
273[endsect]
274
275[section:dot_product dot_product]
276
277'''<indexterm><primary>dot_product</primary></indexterm>'''
278Computes the dot product (or scalar product) of 2 vectors (points).
279
280[heading Synopsis]
281``template<typename Point1, typename Point2>
282select_coordinate_type<Point1, Point2>::type dot_product(Point1 const & p1, Point2 const & p2)``
283
284[heading Parameters]
285
286[table
287[[Type] [Concept] [Name] [Description] ]
288[[Point1 const &] [Any type fulfilling a Point Concept ] [p1] [first point ]]
289[[Point2 const &] [Any type fulfilling a Point Concept ] [p2] [second point ]]
290]
291
292
293[heading Returns]
294the dot product
295
296[heading Header]
297Either
298
299`#include <boost/geometry.hpp>`
300
301
302Or
303
304`#include <boost/geometry/arithmetic/dot_product.hpp>`
305
306[heading Examples]
307[dot_product] [dot_product_output]
308
309
310[endsect]
311
312[section:multiply_point multiply_point]
313
314'''<indexterm><primary>multiply_point</primary></indexterm>'''
315Multiplies a point by another.
316
317[heading Description]
318The coordinates of the first point will be multiplied by those of the second point. The second point is not modified.
319
320[heading Synopsis]
321``template<typename Point1, typename Point2>
322void multiply_point(Point1 & p1, Point2 const & p2)``
323
324[heading Parameters]
325
326[table
327[[Type] [Concept] [Name] [Description] ]
328[[Point1 &] [Any type fulfilling a Point Concept ] [p1] [first point ]]
329[[Point2 const &] [Any type fulfilling a Point Concept ] [p2] [second point ]]
330]
331
332
333[heading Header]
334Either
335
336`#include <boost/geometry.hpp>`
337
338
339Or
340
341`#include <boost/geometry/arithmetic/arithmetic.hpp>`
342
343
344[endsect]
345
346[section:multiply_value multiply_value]
347
348'''<indexterm><primary>multiply_value</primary></indexterm>'''
349Multiplies each coordinate of a point by the same value.
350
351[heading Synopsis]
352``template<typename Point>
353void multiply_value(Point & p, typename detail::param< Point >::type value)``
354
355[heading Parameters]
356
357[table
358[[Type] [Concept] [Name] [Description] ]
359[[Point &] [Any type fulfilling a Point Concept ] [p] [point ]]
360[[typename detail::param< Point >::type] [] [value] [value to multiply by ]]
361]
362
363
364[heading Header]
365Either
366
367`#include <boost/geometry.hpp>`
368
369
370Or
371
372`#include <boost/geometry/arithmetic/arithmetic.hpp>`
373
374
375[endsect]
376
377[section:subtract_point subtract_point]
378
379'''<indexterm><primary>subtract_point</primary></indexterm>'''
380Subtracts a point to another.
381
382[heading Description]
383The coordinates of the second point will be subtracted to those of the first point. The second point is not modified.
384
385[heading Synopsis]
386``template<typename Point1, typename Point2>
387void subtract_point(Point1 & p1, Point2 const & p2)``
388
389[heading Parameters]
390
391[table
392[[Type] [Concept] [Name] [Description] ]
393[[Point1 &] [Any type fulfilling a Point Concept ] [p1] [first point ]]
394[[Point2 const &] [Any type fulfilling a Point Concept ] [p2] [second point ]]
395]
396
397
398[heading Header]
399Either
400
401`#include <boost/geometry.hpp>`
402
403
404Or
405
406`#include <boost/geometry/arithmetic/arithmetic.hpp>`
407
408
409[endsect]
410
411[section:subtract_value subtract_value]
412
413'''<indexterm><primary>subtract_value</primary></indexterm>'''
414Subtracts the same value to each coordinate of a point.
415
416[heading Synopsis]
417``template<typename Point>
418void subtract_value(Point & p, typename detail::param< Point >::type value)``
419
420[heading Parameters]
421
422[table
423[[Type] [Concept] [Name] [Description] ]
424[[Point &] [Any type fulfilling a Point Concept ] [p] [point ]]
425[[typename detail::param< Point >::type] [] [value] [value to subtract ]]
426]
427
428
429[heading Header]
430Either
431
432`#include <boost/geometry.hpp>`
433
434
435Or
436
437`#include <boost/geometry/arithmetic/arithmetic.hpp>`
438
439
440[endsect]
441
442