distance_thomas.hpp 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. // Boost.Geometry
  2. // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
  3. // This file was modified by Oracle on 2015-2017.
  4. // Modifications copyright (c) 2015-2017 Oracle and/or its affiliates.
  5. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
  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)
  9. #ifndef BOOST_GEOMETRY_STRATEGIES_GEOGRAPHIC_THOMAS_HPP
  10. #define BOOST_GEOMETRY_STRATEGIES_GEOGRAPHIC_THOMAS_HPP
  11. #include <boost/geometry/strategies/geographic/distance.hpp>
  12. #include <boost/geometry/strategies/geographic/parameters.hpp>
  13. namespace boost { namespace geometry
  14. {
  15. namespace strategy { namespace distance
  16. {
  17. /*!
  18. \brief The solution of the inverse problem of geodesics on latlong coordinates,
  19. Forsyth-Andoyer-Lambert type approximation with second order terms.
  20. \ingroup distance
  21. \tparam Spheroid The reference spheroid model
  22. \tparam CalculationType \tparam_calculation
  23. \author See
  24. - Technical Report: PAUL D. THOMAS, MATHEMATICAL MODELS FOR NAVIGATION SYSTEMS, 1965
  25. http://www.dtic.mil/docs/citations/AD0627893
  26. - Technical Report: PAUL D. THOMAS, SPHEROIDAL GEODESICS, REFERENCE SYSTEMS, AND LOCAL GEOMETRY, 1970
  27. http://www.dtic.mil/docs/citations/AD703541
  28. */
  29. template
  30. <
  31. typename Spheroid = srs::spheroid<double>,
  32. typename CalculationType = void
  33. >
  34. class thomas
  35. : public strategy::distance::geographic
  36. <
  37. strategy::thomas, Spheroid, CalculationType
  38. >
  39. {
  40. typedef strategy::distance::geographic
  41. <
  42. strategy::thomas, Spheroid, CalculationType
  43. > base_type;
  44. public :
  45. inline thomas()
  46. : base_type()
  47. {}
  48. explicit inline thomas(Spheroid const& spheroid)
  49. : base_type(spheroid)
  50. {}
  51. };
  52. #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
  53. namespace services
  54. {
  55. template <typename Spheroid, typename CalculationType>
  56. struct tag<thomas<Spheroid, CalculationType> >
  57. {
  58. typedef strategy_tag_distance_point_point type;
  59. };
  60. template <typename Spheroid, typename CalculationType, typename P1, typename P2>
  61. struct return_type<thomas<Spheroid, CalculationType>, P1, P2>
  62. : thomas<Spheroid, CalculationType>::template calculation_type<P1, P2>
  63. {};
  64. template <typename Spheroid, typename CalculationType>
  65. struct comparable_type<thomas<Spheroid, CalculationType> >
  66. {
  67. typedef thomas<Spheroid, CalculationType> type;
  68. };
  69. template <typename Spheroid, typename CalculationType>
  70. struct get_comparable<thomas<Spheroid, CalculationType> >
  71. {
  72. static inline thomas<Spheroid, CalculationType> apply(thomas<Spheroid, CalculationType> const& input)
  73. {
  74. return input;
  75. }
  76. };
  77. template <typename Spheroid, typename CalculationType, typename P1, typename P2>
  78. struct result_from_distance<thomas<Spheroid, CalculationType>, P1, P2 >
  79. {
  80. template <typename T>
  81. static inline typename return_type<thomas<Spheroid, CalculationType>, P1, P2>::type
  82. apply(thomas<Spheroid, CalculationType> const& , T const& value)
  83. {
  84. return value;
  85. }
  86. };
  87. } // namespace services
  88. #endif // DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
  89. }} // namespace strategy::distance
  90. }} // namespace boost::geometry
  91. #endif // BOOST_GEOMETRY_STRATEGIES_GEOGRAPHIC_THOMAS_HPP