3 // Copyright (c) 2018 Adeel Ahmad, Islamabad, Pakistan.
5 // Contributed and/or modified by Adeel Ahmad, as part of Google Summer of Code 2018 program.
7 // Use, modification and distribution is subject to the Boost Software License,
8 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
9 // http://www.boost.org/LICENSE_1_0.txt)
11 #ifndef BOOST_GEOMETRY_STRATEGIES_GEOGRAPHIC_KARNEY_HPP
12 #define BOOST_GEOMETRY_STRATEGIES_GEOGRAPHIC_KARNEY_HPP
15 #include <boost/geometry/strategies/geographic/distance.hpp>
16 #include <boost/geometry/strategies/geographic/parameters.hpp>
19 namespace boost { namespace geometry
22 namespace strategy { namespace distance
26 \brief The solution of the inverse problem of geodesics on latlong coordinates,
29 \tparam Spheroid The reference spheroid model
30 \tparam CalculationType \tparam_calculation
32 - Charles F.F Karney, Algorithms for geodesics, 2011
33 https://arxiv.org/pdf/1109.4448.pdf
37 typename Spheroid = srs::spheroid<double>,
38 typename CalculationType = void
41 : public strategy::distance::geographic
43 strategy::karney, Spheroid, CalculationType
46 typedef strategy::distance::geographic
48 strategy::karney, Spheroid, CalculationType
56 explicit inline karney(Spheroid const& spheroid)
61 #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
65 template <typename Spheroid, typename CalculationType>
66 struct tag<karney<Spheroid, CalculationType> >
68 typedef strategy_tag_distance_point_point type;
72 template <typename Spheroid, typename CalculationType, typename P1, typename P2>
73 struct return_type<karney<Spheroid, CalculationType>, P1, P2>
74 : karney<Spheroid, CalculationType>::template calculation_type<P1, P2>
78 template <typename Spheroid, typename CalculationType>
79 struct comparable_type<karney<Spheroid, CalculationType> >
81 typedef karney<Spheroid, CalculationType> type;
85 template <typename Spheroid, typename CalculationType>
86 struct get_comparable<karney<Spheroid, CalculationType> >
88 static inline karney<Spheroid, CalculationType> apply(karney<Spheroid, CalculationType> const& input)
94 template <typename Spheroid, typename CalculationType, typename P1, typename P2>
95 struct result_from_distance<karney<Spheroid, CalculationType>, P1, P2 >
98 static inline typename return_type<karney<Spheroid, CalculationType>, P1, P2>::type
99 apply(karney<Spheroid, CalculationType> const& , T const& value)
106 } // namespace services
107 #endif // DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
110 }} // namespace strategy::distance
113 }} // namespace boost::geometry
116 #endif // BOOST_GEOMETRY_STRATEGIES_GEOGRAPHIC_KARNEY_HPP