3 // Copyright (c) 2017 Oracle and/or its affiliates.
5 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
7 // Use, modification and distribution is subject to the Boost Software License,
8 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
9 // http://www.boost.org/LICENSE_1_0.txt)
11 #ifndef BOOST_GEOMETRY_FORMULAS_UNIT_SPHEROID_HPP
12 #define BOOST_GEOMETRY_FORMULAS_UNIT_SPHEROID_HPP
14 #include <boost/geometry/core/radius.hpp>
16 namespace boost { namespace geometry
19 #ifndef DOXYGEN_NO_DETAIL
23 template <typename ResultType, typename Spheroid>
24 inline ResultType unit_spheroid_b(Spheroid const& spheroid)
26 return ResultType(get_radius<2>(spheroid))
27 / ResultType(get_radius<0>(spheroid));
30 template <typename ResultSpheroid, typename Spheroid>
31 inline ResultSpheroid unit_spheroid(Spheroid const& spheroid)
33 typedef typename radius_type<ResultSpheroid>::type radius_t;
34 return ResultSpheroid(radius_t(1),
35 unit_spheroid_b<radius_t>(spheroid));
38 } // namespace formula
39 #endif // DOXYGEN_NO_DETAIL
41 }} // namespace boost::geometry
43 #endif // BOOST_GEOMETRY_FORMULAS_UNIT_SPHEROID_HPP