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