[/============================================================================== Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. Copyright (c) 2008-2012 Bruno Lalande, Paris, France. Copyright (c) 2009-2012 Mateusz Loskot, London, UK., London, UK Use, modification and distribution is subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ===============================================================================/] [section Arithmetic] __boost_geometry__ provides a set of arithmetic operations defined for point geometries. [section add_point] [heading Description] Adds one point to another. [heading Synopsis] namespace boost { namespace geometry { template void add_point(Point1 &p1, Point2 const &p2); }} [table Parameters [[Parameter] [Requirement] [Description]] [[`p1`, `p2`] [Models of __concept_point__] [First point used as operation input and output. Second point usedas input]] ] [table Expression Semantics [[Expression] [Return Type] [Description]] [[__add_point__(p1, p2);] [`void`] [Coordinates of `p2` are added to corresponding coordinates of `p1`. The `p2` is not modified]] ] [heading Header] #include [heading Example] #include #include #include #include int main() { using namespace boost::geometry; point_xy p1(1, 3); point_xy p2(2, 4); add_point(p1, p2); std::cout << "p1 = " << dsv(p1) << std::endl; } [endsect] [/ end of section add_point] [section add_value] [heading Description] Adds a value to each coordinate of a point. [heading Synopsis] namespace boost { namespace geometry { template void add_value(Point &p, typename detail::param::type value) }} [heading Header] #include [heading Example] int foo(); [endsect] [/ end of section add_value] [section divide_point] [heading Description] Divides a point by another. [heading Synopsis] namespace boost { namespace geometry { template void divide_point(Point1 &p1, Point2 const &p2); }} [heading Header] #include [heading Example] int foo(); [endsect] [/ end of section divide_point] [section divide_value] [heading Description] Divides each coordinate of a point by a value. [heading Synopsis] namespace boost { namespace geometry { template void divide_value(Point &p, typename detail::param< Point>::type value); }} [heading Header] #include [heading Example] int foo(); [endsect] [/ end of section divide_value] [section multiply_point] [heading Description] Multiplies a point by another. [heading Synopsis] namespace boost { namespace geometry { template void multiply_point(Point1 &p1, Point2 const &p2); }} [heading Header] #include [heading Example] int foo(); [endsect] [/ end of section multiply_point] [section multiply_value] [heading Description] Multiplies each coordinate of a point by a value. [heading Synopsis] namespace boost { namespace geometry { template void multiply_value(Point &p, typename detail::param::type value); }} [heading Header] #include [heading Example] int foo(); [endsect] [/ end of section multiply_value] [section subtract_point] [heading Description] Subtracts a point to another. [heading Synopsis] namespace boost { namespace geometry { template void subtract_point(Point1 &p1, Point2 const &p2) }} [heading Header] #include [heading Example] int foo(); [endsect] [/ end of section subtract_point] [section subtract_value] [heading Description] Subtracts a value to each coordinate of a point. [heading Synopsis] namespace boost { namespace geometry { template void subtract_value(Point &p, typename detail::param::type value) }} [heading Header] #include [heading Example] int foo(); [endsect] [/ end of section subtract_value] [endsect] [/ end of section Arithmetic]