PageRenderTime 21ms CodeModel.GetById 15ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 1// Boost.Geometry (aka GGL, Generic Geometry Library)
 2// QuickBook Example
 3
 4// Copyright (c) 2011 Barend Gehrels, Amsterdam, the Netherlands.
 5
 6// Use, modification and distribution is subject to the Boost Software License,
 7// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 8// http://www.boost.org/LICENSE_1_0.txt)
 9
10//[c_array
11//` Small example showing the combination of an array with a Boost.Geometry algorithm
12
13#include <iostream>
14#include <boost/geometry.hpp>
15#include <boost/geometry/geometries/adapted/c_array.hpp>
16
17BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) 
18
19int main()
20{
21    int a[3] = {1, 2, 3};
22    int b[3] = {2, 3, 4};
23
24    std::cout << boost::geometry::distance(a, b) << std::endl;
25    
26    return 0;
27}
28
29//]
30
31//[c_array_output
32/*`
33Output:
34[pre
351.73205
36]
37*/
38//]