is_inverse_spheroidal_coordinates.hpp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // Boost.Geometry
  2. // Copyright (c) 2018 Oracle and/or its affiliates.
  3. // Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
  4. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
  5. // Use, modification and distribution is subject to the Boost Software License,
  6. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  7. // http://www.boost.org/LICENSE_1_0.txt)
  8. #ifndef BOOST_GEOMETRY_UTIL_IS_INVERSE_SPHEROIDAL_COORDINATES_HPP
  9. #define BOOST_GEOMETRY_UTIL_IS_INVERSE_SPHEROIDAL_COORDINATES_HPP
  10. #include <boost/geometry/core/access.hpp>
  11. #include <boost/geometry/core/coordinate_type.hpp>
  12. #include <boost/geometry/core/point_type.hpp>
  13. #include <boost/geometry/util/math.hpp>
  14. namespace boost { namespace geometry
  15. {
  16. template<class CT>
  17. struct bounds
  18. {
  19. static CT lowest () { return boost::numeric::bounds<CT>::lowest(); }
  20. static CT highest () { return boost::numeric::bounds<CT>::highest(); }
  21. };
  22. template <typename Box>
  23. bool is_inverse_spheroidal_coordinates(Box const& box)
  24. {
  25. typedef typename point_type<Box>::type point_type;
  26. typedef typename coordinate_type<point_type>::type bound_type;
  27. bound_type high = bounds<bound_type>::highest();
  28. bound_type low = bounds<bound_type>::lowest();
  29. return (geometry::get<0, 0>(box) == high) &&
  30. (geometry::get<0, 1>(box) == high) &&
  31. (geometry::get<1, 0>(box) == low) &&
  32. (geometry::get<1, 1>(box) == low);
  33. }
  34. }} // namespace boost::geometry
  35. #endif // BOOST_GEOMETRY_UTIL_IS_INVERSE_SPHEROIDAL_COORDINATES_HPP