]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/geometry/doc/src/examples/core/degree_radian.cpp
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
4 // Copyright (c) 2011-2012 Barend Gehrels, Amsterdam, the Netherlands.
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)
11 //` Specify two coordinate systems, one in degrees, one in radians.
14 #include <boost/geometry.hpp>
16 using namespace boost::geometry
;
20 typedef model::point
<double, 2, cs::spherical_equatorial
<degree
> > degree_point
;
21 typedef model::point
<double, 2, cs::spherical_equatorial
<radian
> > radian_point
;
23 degree_point
d(4.893, 52.373);
24 radian_point
r(0.041, 0.8527);
26 double dist
= distance(d
, r
);
28 << "distance:" << std::endl
29 << dist
<< " over unit sphere" << std::endl
30 << dist
* 3959 << " over a spherical earth, in miles" << std::endl
;
38 //[degree_radian_output
43 0.0675272 over unit sphere
44 267.34 over a spherical earth, in miles