Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:36:46

0001 // Boost.Geometry
0002 
0003 // Copyright (c) 2018 Adeel Ahmad, Islamabad, Pakistan.
0004 
0005 // Contributed and/or modified by Adeel Ahmad, as part of Google Summer of Code 2018 program.
0006 
0007 // Use, modification and distribution is subject to the Boost Software License,
0008 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0009 // http://www.boost.org/LICENSE_1_0.txt)
0010 
0011 #ifndef BOOST_GEOMETRY_STRATEGIES_GEOGRAPHIC_KARNEY_HPP
0012 #define BOOST_GEOMETRY_STRATEGIES_GEOGRAPHIC_KARNEY_HPP
0013 
0014 
0015 #include <boost/geometry/strategies/geographic/distance.hpp>
0016 #include <boost/geometry/strategies/geographic/parameters.hpp>
0017 
0018 
0019 namespace boost { namespace geometry
0020 {
0021 
0022 namespace strategy { namespace distance
0023 {
0024 
0025 /*!
0026 \brief The solution of the inverse problem of geodesics on latlong coordinates,
0027        after Karney (2011).
0028 \ingroup distance
0029 \tparam Spheroid The reference spheroid model
0030 \tparam CalculationType \tparam_calculation
0031 \author See
0032 - Charles F.F Karney, Algorithms for geodesics, 2011
0033 https://arxiv.org/pdf/1109.4448.pdf
0034 */
0035 template
0036 <
0037     typename Spheroid = srs::spheroid<double>,
0038     typename CalculationType = void
0039 >
0040 class karney
0041     : public strategy::distance::geographic
0042         <
0043             strategy::karney, Spheroid, CalculationType
0044         >
0045 {
0046     typedef strategy::distance::geographic
0047         <
0048             strategy::karney, Spheroid, CalculationType
0049         > base_type;
0050 
0051 public:
0052     inline karney()
0053         : base_type()
0054     {}
0055 
0056     explicit inline karney(Spheroid const& spheroid)
0057         : base_type(spheroid)
0058     {}
0059 };
0060 
0061 #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
0062 namespace services
0063 {
0064 
0065 template <typename Spheroid, typename CalculationType>
0066 struct tag<karney<Spheroid, CalculationType> >
0067 {
0068     typedef strategy_tag_distance_point_point type;
0069 };
0070 
0071 
0072 template <typename Spheroid, typename CalculationType, typename P1, typename P2>
0073 struct return_type<karney<Spheroid, CalculationType>, P1, P2>
0074     : karney<Spheroid, CalculationType>::template calculation_type<P1, P2>
0075 {};
0076 
0077 
0078 template <typename Spheroid, typename CalculationType>
0079 struct comparable_type<karney<Spheroid, CalculationType> >
0080 {
0081     typedef karney<Spheroid, CalculationType> type;
0082 };
0083 
0084 
0085 template <typename Spheroid, typename CalculationType>
0086 struct get_comparable<karney<Spheroid, CalculationType> >
0087 {
0088     static inline karney<Spheroid, CalculationType> apply(karney<Spheroid, CalculationType> const& input)
0089     {
0090         return input;
0091     }
0092 };
0093 
0094 template <typename Spheroid, typename CalculationType, typename P1, typename P2>
0095 struct result_from_distance<karney<Spheroid, CalculationType>, P1, P2 >
0096 {
0097     template <typename T>
0098     static inline typename return_type<karney<Spheroid, CalculationType>, P1, P2>::type
0099         apply(karney<Spheroid, CalculationType> const& , T const& value)
0100     {
0101         return value;
0102     }
0103 };
0104 
0105 
0106 } // namespace services
0107 #endif // DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
0108 
0109 
0110 }} // namespace strategy::distance
0111 
0112 
0113 }} // namespace boost::geometry
0114 
0115 
0116 #endif // BOOST_GEOMETRY_STRATEGIES_GEOGRAPHIC_KARNEY_HPP