1 // Boost.Geometry (aka GGL, Generic Geometry Library)
3 // Copyright (c) 2016-2017 Oracle and/or its affiliates.
4 // Contributed and/or modified by Vissarion Fisikopoulos, on behalf of Oracle
5 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
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_AZIMUTH_HPP
12 #define BOOST_GEOMETRY_STRATEGIES_GEOGRAPHIC_AZIMUTH_HPP
15 #include <boost/geometry/core/srs.hpp>
17 #include <boost/geometry/strategies/azimuth.hpp>
18 #include <boost/geometry/strategies/geographic/parameters.hpp>
20 #include <boost/mpl/if.hpp>
21 #include <boost/type_traits/is_void.hpp>
24 namespace boost { namespace geometry
27 namespace strategy { namespace azimuth
32 typename FormulaPolicy = strategy::andoyer,
33 typename Spheroid = srs::spheroid<double>,
34 typename CalculationType = void
40 typedef Spheroid model_type;
46 explicit inline geographic(Spheroid const& spheroid)
47 : m_spheroid(spheroid)
50 inline model_type const& model() const
56 inline void apply(T const& lon1_rad, T const& lat1_rad,
57 T const& lon2_rad, T const& lat2_rad,
60 typedef typename boost::mpl::if_
62 boost::is_void<CalculationType>, T, CalculationType
65 typedef typename FormulaPolicy::template inverse<calc_t, false, true, true, false, false> inverse_type;
66 typedef typename inverse_type::result_type inverse_result;
67 inverse_result i_res = inverse_type::apply(calc_t(lon1_rad), calc_t(lat1_rad),
68 calc_t(lon2_rad), calc_t(lat2_rad),
71 a2 = i_res.reverse_azimuth;
78 #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
83 template <typename CalculationType>
84 struct default_strategy<geographic_tag, CalculationType>
86 typedef strategy::azimuth::geographic
89 srs::spheroid<double>,
96 #endif // DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
98 }} // namespace strategy::azimuth
101 }} // namespace boost::geometry
103 #endif // BOOST_GEOMETRY_STRATEGIES_GEOGRAPHIC_AZIMUTH_HPP