PageRenderTime 16ms CodeModel.GetById 13ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/Src/Dependencies/Boost/libs/geometry/doc/src/examples/algorithms/assign_3d_point.cpp

http://hadesmem.googlecode.com/
C++ | 39 lines | 11 code | 11 blank | 17 comment | 0 complexity | 6b72ab8f36d93b1129059a17caae9eb1 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//[assign_3d_point
11//` Use assign to set three coordinates of a 3D point
12
13#include <iostream>
14#include <iomanip>
15
16#include <boost/geometry.hpp>
17#include <boost/geometry/geometries/point.hpp>
18
19int main()
20{
21    boost::geometry::model::point<double, 3, boost::geometry::cs::cartesian> p;
22    boost::geometry::assign_values(p, 1.2345, 2.3456, 3.4567);
23
24    std::cout << boost::geometry::dsv(p) << std::endl;
25
26    return 0;
27}
28
29//]
30
31
32//[assign_3d_point_output
33/*`
34Output:
35[pre
36(1.2345, 2.3456, 3.4567)
37]
38*/
39//]