Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Boost.Geometry (aka GGL, Generic Geometry Library)
0002 
0003 // Copyright (c) 2007-2016 Barend Gehrels, Amsterdam, the Netherlands.
0004 
0005 // This file was modified by Oracle on 2014, 2017.
0006 // Modifications copyright (c) 2014-2017 Oracle and/or its affiliates.
0007 
0008 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
0009 
0010 // Use, modification and distribution is subject to the Boost Software License,
0011 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0012 // http://www.boost.org/LICENSE_1_0.txt)
0013 
0014 #ifndef BOOST_GEOMETRY_STRATEGIES_GEOGRAPHIC_DISTANCE_DETAIL_HPP
0015 #define BOOST_GEOMETRY_STRATEGIES_GEOGRAPHIC_DISTANCE_DETAIL_HPP
0016 
0017 
0018 #include <boost/geometry/strategies/geographic/distance.hpp>
0019 #include <boost/geometry/strategies/geographic/parameters.hpp>
0020 
0021 
0022 namespace boost { namespace geometry
0023 {
0024 
0025 namespace strategy { namespace distance
0026 {
0027 
0028 
0029 /*!
0030 \brief Point-point distance approximation taking flattening into account
0031 \ingroup distance
0032 \tparam Spheroid The reference spheroid model
0033 \tparam CalculationType \tparam_calculation
0034 \author After Andoyer, 19xx, republished 1950, republished by Meeus, 1999
0035 \note Although not so well-known, the approximation is very good: in all cases the results
0036 are about the same as Vincenty. In my (Barend's) testcases the results didn't differ more than 6 m
0037 \see http://nacc.upc.es/tierra/node16.html
0038 \see http://sci.tech-archive.net/Archive/sci.geo.satellite-nav/2004-12/2724.html
0039 \see http://home.att.net/~srschmitt/great_circle_route.html (implementation)
0040 \see http://www.codeguru.com/Cpp/Cpp/algorithms/article.php/c5115 (implementation)
0041 \see http://futureboy.homeip.net/frinksamp/navigation.frink (implementation)
0042 \see http://www.voidware.com/earthdist.htm (implementation)
0043 \see http://www.dtic.mil/docs/citations/AD0627893
0044 \see http://www.dtic.mil/docs/citations/AD703541
0045 */
0046 template
0047 <
0048     typename Spheroid = srs::spheroid<double>,
0049     typename CalculationType = void
0050 >
0051 class andoyer
0052     : public strategy::distance::geographic
0053         <
0054             strategy::andoyer, Spheroid, CalculationType
0055         >
0056 {
0057     typedef strategy::distance::geographic
0058         <
0059             strategy::andoyer, Spheroid, CalculationType
0060         > base_type;
0061 
0062 public :
0063     inline andoyer()
0064         : base_type()
0065     {}
0066 
0067     explicit inline andoyer(Spheroid const& spheroid)
0068         : base_type(spheroid)
0069     {}
0070 };
0071 
0072 
0073 #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
0074 namespace services
0075 {
0076 
0077 template <typename Spheroid, typename CalculationType>
0078 struct tag<andoyer<Spheroid, CalculationType> >
0079 {
0080     typedef strategy_tag_distance_point_point type;
0081 };
0082 
0083 
0084 template <typename Spheroid, typename CalculationType, typename P1, typename P2>
0085 struct return_type<andoyer<Spheroid, CalculationType>, P1, P2>
0086     : andoyer<Spheroid, CalculationType>::template calculation_type<P1, P2>
0087 {};
0088 
0089 
0090 template <typename Spheroid, typename CalculationType>
0091 struct comparable_type<andoyer<Spheroid, CalculationType> >
0092 {
0093     typedef andoyer<Spheroid, CalculationType> type;
0094 };
0095 
0096 
0097 template <typename Spheroid, typename CalculationType>
0098 struct get_comparable<andoyer<Spheroid, CalculationType> >
0099 {
0100     static inline andoyer<Spheroid, CalculationType> apply(andoyer<Spheroid, CalculationType> const& input)
0101     {
0102         return input;
0103     }
0104 };
0105 
0106 template <typename Spheroid, typename CalculationType, typename P1, typename P2>
0107 struct result_from_distance<andoyer<Spheroid, CalculationType>, P1, P2>
0108 {
0109     template <typename T>
0110     static inline typename return_type<andoyer<Spheroid, CalculationType>, P1, P2>::type
0111         apply(andoyer<Spheroid, CalculationType> const& , T const& value)
0112     {
0113         return value;
0114     }
0115 };
0116 
0117 
0118 } // namespace services
0119 #endif // DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
0120 
0121 
0122 }} // namespace strategy::distance
0123 
0124 
0125 }} // namespace boost::geometry
0126 
0127 
0128 #endif // BOOST_GEOMETRY_STRATEGIES_GEOGRAPHIC_DISTANCE_DETAIL_HPP