]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/geometry/strategies/geographic/distance_andoyer.hpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / boost / geometry / strategies / geographic / distance_andoyer.hpp
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
2
3 // Copyright (c) 2007-2016 Barend Gehrels, Amsterdam, the Netherlands.
4
5 // This file was modified by Oracle on 2014, 2017.
6 // Modifications copyright (c) 2014-2017 Oracle and/or its affiliates.
7
8 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
9
10 // Use, modification and distribution is subject to the Boost Software License,
11 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
12 // http://www.boost.org/LICENSE_1_0.txt)
13
14 #ifndef BOOST_GEOMETRY_STRATEGIES_GEOGRAPHIC_DISTANCE_DETAIL_HPP
15 #define BOOST_GEOMETRY_STRATEGIES_GEOGRAPHIC_DISTANCE_DETAIL_HPP
16
17
18 #include <boost/geometry/strategies/geographic/distance.hpp>
19 #include <boost/geometry/strategies/geographic/parameters.hpp>
20
21
22 namespace boost { namespace geometry
23 {
24
25 namespace strategy { namespace distance
26 {
27
28
29 /*!
30 \brief Point-point distance approximation taking flattening into account
31 \ingroup distance
32 \tparam Spheroid The reference spheroid model
33 \tparam CalculationType \tparam_calculation
34 \author After Andoyer, 19xx, republished 1950, republished by Meeus, 1999
35 \note Although not so well-known, the approximation is very good: in all cases the results
36 are about the same as Vincenty. In my (Barend's) testcases the results didn't differ more than 6 m
37 \see http://nacc.upc.es/tierra/node16.html
38 \see http://sci.tech-archive.net/Archive/sci.geo.satellite-nav/2004-12/2724.html
39 \see http://home.att.net/~srschmitt/great_circle_route.html (implementation)
40 \see http://www.codeguru.com/Cpp/Cpp/algorithms/article.php/c5115 (implementation)
41 \see http://futureboy.homeip.net/frinksamp/navigation.frink (implementation)
42 \see http://www.voidware.com/earthdist.htm (implementation)
43 \see http://www.dtic.mil/docs/citations/AD0627893
44 \see http://www.dtic.mil/docs/citations/AD703541
45 */
46 template
47 <
48 typename Spheroid = srs::spheroid<double>,
49 typename CalculationType = void
50 >
51 class andoyer
52 : public strategy::distance::geographic
53 <
54 strategy::andoyer, Spheroid, CalculationType
55 >
56 {
57 typedef strategy::distance::geographic
58 <
59 strategy::andoyer, Spheroid, CalculationType
60 > base_type;
61
62 public :
63 inline andoyer()
64 : base_type()
65 {}
66
67 explicit inline andoyer(Spheroid const& spheroid)
68 : base_type(spheroid)
69 {}
70 };
71
72
73 #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
74 namespace services
75 {
76
77 template <typename Spheroid, typename CalculationType>
78 struct tag<andoyer<Spheroid, CalculationType> >
79 {
80 typedef strategy_tag_distance_point_point type;
81 };
82
83
84 template <typename Spheroid, typename CalculationType, typename P1, typename P2>
85 struct return_type<andoyer<Spheroid, CalculationType>, P1, P2>
86 : andoyer<Spheroid, CalculationType>::template calculation_type<P1, P2>
87 {};
88
89
90 template <typename Spheroid, typename CalculationType>
91 struct comparable_type<andoyer<Spheroid, CalculationType> >
92 {
93 typedef andoyer<Spheroid, CalculationType> type;
94 };
95
96
97 template <typename Spheroid, typename CalculationType>
98 struct get_comparable<andoyer<Spheroid, CalculationType> >
99 {
100 static inline andoyer<Spheroid, CalculationType> apply(andoyer<Spheroid, CalculationType> const& input)
101 {
102 return input;
103 }
104 };
105
106 template <typename Spheroid, typename CalculationType, typename P1, typename P2>
107 struct result_from_distance<andoyer<Spheroid, CalculationType>, P1, P2>
108 {
109 template <typename T>
110 static inline typename return_type<andoyer<Spheroid, CalculationType>, P1, P2>::type
111 apply(andoyer<Spheroid, CalculationType> const& , T const& value)
112 {
113 return value;
114 }
115 };
116
117
118 } // namespace services
119 #endif // DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
120
121
122 }} // namespace strategy::distance
123
124
125 }} // namespace boost::geometry
126
127
128 #endif // BOOST_GEOMETRY_STRATEGIES_GEOGRAPHIC_DISTANCE_DETAIL_HPP