Imported Upstream version 1.57.0
[platform/upstream/boost.git] / libs / geometry / doc / src / examples / geometries / adapted / boost_polygon_point.cpp
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
2 // QuickBook Example
3
4 // Copyright (c) 2011-2012 Barend Gehrels, Amsterdam, the Netherlands.
5 // Copyright (c) 2014 Adam Wulkiewicz, Lodz, Poland.
6
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)
10
11 //[boost_polygon_point
12 //`Shows how to use Boost.Polygon point_data within Boost.Geometry
13
14 #include <iostream>
15 #include <boost/geometry.hpp>
16 #include <boost/geometry/geometries/adapted/boost_polygon.hpp>
17
18 int main()
19 {
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;
25
26     return 0;
27 }
28
29 //]
30
31 //[boost_polygon_point_output
32 /*`
33 Output:
34 [pre
35 Distance (using Boost.Geometry): 2.82843
36 Distance (using Boost.Polygon): 2.82843
37 ]
38 */
39 //]