/Src/Dependencies/Boost/libs/geometry/doc/src/examples/geometries/adapted/c_array.cpp
http://hadesmem.googlecode.com/ · C++ · 38 lines · 11 code · 10 blank · 17 comment · 0 complexity · cef238d4570f001a083d716a74515dbb MD5 · raw file
- // Boost.Geometry (aka GGL, Generic Geometry Library)
- // QuickBook Example
- // Copyright (c) 2011 Barend Gehrels, Amsterdam, the Netherlands.
- // 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)
- //[c_array
- //` Small example showing the combination of an array with a Boost.Geometry algorithm
- #include <iostream>
- #include <boost/geometry.hpp>
- #include <boost/geometry/geometries/adapted/c_array.hpp>
- BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian)
- int main()
- {
- int a[3] = {1, 2, 3};
- int b[3] = {2, 3, 4};
- std::cout << boost::geometry::distance(a, b) << std::endl;
-
- return 0;
- }
- //]
- //[c_array_output
- /*`
- Output:
- [pre
- 1.73205
- ]
- */
- //]