is_inverse_spheroidal_coordinates.hpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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/bounds.hpp>
  14. #include <boost/geometry/util/math.hpp>
  15. namespace boost { namespace geometry
  16. {
  17. template <typename Box>
  18. bool is_inverse_spheroidal_coordinates(Box const& box)
  19. {
  20. typedef typename point_type<Box>::type point_type;
  21. typedef typename coordinate_type<point_type>::type bound_type;
  22. bound_type const high = util::bounds<bound_type>::highest();
  23. bound_type const low = util::bounds<bound_type>::lowest();
  24. return (geometry::get<0, 0>(box) == high) &&
  25. (geometry::get<0, 1>(box) == high) &&
  26. (geometry::get<1, 0>(box) == low) &&
  27. (geometry::get<1, 1>(box) == low);
  28. }
  29. }} // namespace boost::geometry
  30. #endif // BOOST_GEOMETRY_UTIL_IS_INVERSE_SPHEROIDAL_COORDINATES_HPP