12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- #ifndef BOOST_GEOMETRY_PROJECTIONS_IMPL_ADJLON_HPP
- #define BOOST_GEOMETRY_PROJECTIONS_IMPL_ADJLON_HPP
- #include <boost/math/constants/constants.hpp>
- #include <boost/geometry/util/math.hpp>
- namespace boost { namespace geometry { namespace projections
- {
- namespace detail
- {
- template <typename T>
- inline T adjlon (T lon)
- {
- if (geometry::math::abs(lon) <= boost::math::constants::pi<T>())
- {
- return lon;
- }
-
- lon += boost::math::constants::pi<T>();
-
- lon -= boost::math::constants::two_pi<T>() *
- std::floor(lon / boost::math::constants::two_pi<T>());
-
- lon -= boost::math::constants::pi<T>();
- return lon;
- }
- }
- }}}
- #endif
|