1 // Boost.Geometry 2 3 // Copyright (c) 2018, Oracle and/or its affiliates. 4 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle 5 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 10 11 #ifndef BOOST_GEOMETRY_PROJECTIONS_CONSTANTS_HPP 12 #define BOOST_GEOMETRY_PROJECTIONS_CONSTANTS_HPP 13 14 15 #include <boost/geometry/util/math.hpp> 16 #include <boost/math/constants/constants.hpp> 17 18 19 namespace boost { namespace geometry { namespace projections 20 { 21 22 #ifndef DOXYGEN_NO_DETAIL 23 namespace detail 24 { 25 26 27 template <typename T> fourth_pi()28inline T fourth_pi() { return T(0.78539816339744830961566084581988); } 29 template <typename T> third_pi()30inline T third_pi() { return boost::math::constants::third_pi<T>(); } 31 template <typename T> half_pi()32inline T half_pi() { return boost::math::constants::half_pi<T>(); } 33 template <typename T> pi()34inline T pi() { return boost::math::constants::pi<T>(); } 35 template <typename T> one_and_half_pi()36inline T one_and_half_pi() { return T(4.7123889803846898576939650749193); } 37 template <typename T> two_pi()38inline T two_pi() { return boost::math::constants::two_pi<T>(); } 39 template <typename T> two_and_half_pi()40inline T two_and_half_pi() { return T(7.8539816339744830961566084581988); } 41 42 template <typename T> two_div_pi()43inline T two_div_pi() { return boost::math::constants::two_div_pi<T>(); } 44 template <typename T> half_pi_sqr()45inline T half_pi_sqr() { return T(2.4674011002723396547086227499689); } 46 template <typename T> pi_sqr()47inline T pi_sqr() { return boost::math::constants::pi_sqr<T>(); } 48 49 template <typename T> sixth()50inline T sixth() { return boost::math::constants::sixth<T>(); } 51 template <typename T> third()52inline T third() { return boost::math::constants::third<T>(); } 53 template <typename T> two_thirds()54inline T two_thirds() { return boost::math::constants::two_thirds<T>(); } 55 56 57 } // namespace detail 58 #endif // DOXYGEN_NO_DETAIL 59 60 61 }}} // namespace boost::geometry::projections 62 #endif // BOOST_GEOMETRY_PROJECTIONS_IMPL_PROJECTS_HPP 63