1 // Boost.Geometry (aka GGL, Generic Geometry Library)
4 // Copyright (c) 2011-2012 Barend Gehrels, Amsterdam, the Netherlands.
5 // Copyright (c) 2014 Adam Wulkiewicz, Lodz, Poland.
7 // Use, modification and distribution is subject to the Boost Software License,
8 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
9 // http://www.boost.org/LICENSE_1_0.txt)
11 //[boost_polygon_point
12 //`Shows how to use Boost.Polygon point_data within Boost.Geometry
15 #include <boost/geometry.hpp>
16 #include <boost/geometry/geometries/adapted/boost_polygon.hpp>
20 boost::polygon::point_data<int> a(1, 2), b(3, 4);
21 std::cout << "Distance (using Boost.Geometry): "
22 << boost::geometry::distance(a, b) << std::endl;
23 std::cout << "Distance (using Boost.Polygon): "
24 << boost::polygon::euclidean_distance(a, b) << std::endl;
31 //[boost_polygon_point_output
35 Distance (using Boost.Geometry): 2.82843
36 Distance (using Boost.Polygon): 2.82843