]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/geometry/strategies/geographic/distance_thomas.hpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / boost / geometry / strategies / geographic / distance_thomas.hpp
1 // Boost.Geometry
2
3 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
4
5 // This file was modified by Oracle on 2015-2017.
6 // Modifications copyright (c) 2015-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_THOMAS_HPP
15 #define BOOST_GEOMETRY_STRATEGIES_GEOGRAPHIC_THOMAS_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 \brief The solution of the inverse problem of geodesics on latlong coordinates,
30 Forsyth-Andoyer-Lambert type approximation with second order terms.
31 \ingroup distance
32 \tparam Spheroid The reference spheroid model
33 \tparam CalculationType \tparam_calculation
34 \author See
35 - Technical Report: PAUL D. THOMAS, MATHEMATICAL MODELS FOR NAVIGATION SYSTEMS, 1965
36 http://www.dtic.mil/docs/citations/AD0627893
37 - Technical Report: PAUL D. THOMAS, SPHEROIDAL GEODESICS, REFERENCE SYSTEMS, AND LOCAL GEOMETRY, 1970
38 http://www.dtic.mil/docs/citations/AD703541
39 */
40 template
41 <
42 typename Spheroid = srs::spheroid<double>,
43 typename CalculationType = void
44 >
45 class thomas
46 : public strategy::distance::geographic
47 <
48 strategy::thomas, Spheroid, CalculationType
49 >
50 {
51 typedef strategy::distance::geographic
52 <
53 strategy::thomas, Spheroid, CalculationType
54 > base_type;
55
56 public :
57 inline thomas()
58 : base_type()
59 {}
60
61 explicit inline thomas(Spheroid const& spheroid)
62 : base_type(spheroid)
63 {}
64 };
65
66 #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
67 namespace services
68 {
69
70 template <typename Spheroid, typename CalculationType>
71 struct tag<thomas<Spheroid, CalculationType> >
72 {
73 typedef strategy_tag_distance_point_point type;
74 };
75
76
77 template <typename Spheroid, typename CalculationType, typename P1, typename P2>
78 struct return_type<thomas<Spheroid, CalculationType>, P1, P2>
79 : thomas<Spheroid, CalculationType>::template calculation_type<P1, P2>
80 {};
81
82
83 template <typename Spheroid, typename CalculationType>
84 struct comparable_type<thomas<Spheroid, CalculationType> >
85 {
86 typedef thomas<Spheroid, CalculationType> type;
87 };
88
89
90 template <typename Spheroid, typename CalculationType>
91 struct get_comparable<thomas<Spheroid, CalculationType> >
92 {
93 static inline thomas<Spheroid, CalculationType> apply(thomas<Spheroid, CalculationType> const& input)
94 {
95 return input;
96 }
97 };
98
99 template <typename Spheroid, typename CalculationType, typename P1, typename P2>
100 struct result_from_distance<thomas<Spheroid, CalculationType>, P1, P2 >
101 {
102 template <typename T>
103 static inline typename return_type<thomas<Spheroid, CalculationType>, P1, P2>::type
104 apply(thomas<Spheroid, CalculationType> const& , T const& value)
105 {
106 return value;
107 }
108 };
109
110
111 } // namespace services
112 #endif // DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
113
114
115 }} // namespace strategy::distance
116
117
118 }} // namespace boost::geometry
119
120
121 #endif // BOOST_GEOMETRY_STRATEGIES_GEOGRAPHIC_THOMAS_HPP