]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/geometry/srs/projections/proj/lask.hpp
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / boost / boost / geometry / srs / projections / proj / lask.hpp
1 #ifndef BOOST_GEOMETRY_PROJECTIONS_LASK_HPP
2 #define BOOST_GEOMETRY_PROJECTIONS_LASK_HPP
3
4 // Boost.Geometry - extensions-gis-projections (based on PROJ4)
5 // This file is automatically generated. DO NOT EDIT.
6
7 // Copyright (c) 2008-2015 Barend Gehrels, Amsterdam, the Netherlands.
8
9 // This file was modified by Oracle on 2017.
10 // Modifications copyright (c) 2017, Oracle and/or its affiliates.
11 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle.
12
13 // Use, modification and distribution is subject to the Boost Software License,
14 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
15 // http://www.boost.org/LICENSE_1_0.txt)
16
17 // This file is converted from PROJ4, http://trac.osgeo.org/proj
18 // PROJ4 is originally written by Gerald Evenden (then of the USGS)
19 // PROJ4 is maintained by Frank Warmerdam
20 // PROJ4 is converted to Boost.Geometry by Barend Gehrels
21
22 // Last updated version of proj: 4.9.1
23
24 // Original copyright notice:
25
26 // Permission is hereby granted, free of charge, to any person obtaining a
27 // copy of this software and associated documentation files (the "Software"),
28 // to deal in the Software without restriction, including without limitation
29 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
30 // and/or sell copies of the Software, and to permit persons to whom the
31 // Software is furnished to do so, subject to the following conditions:
32
33 // The above copyright notice and this permission notice shall be included
34 // in all copies or substantial portions of the Software.
35
36 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
37 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
38 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
39 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
40 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
41 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
42 // DEALINGS IN THE SOFTWARE.
43
44 #include <boost/geometry/srs/projections/impl/base_static.hpp>
45 #include <boost/geometry/srs/projections/impl/base_dynamic.hpp>
46 #include <boost/geometry/srs/projections/impl/projects.hpp>
47 #include <boost/geometry/srs/projections/impl/factory_entry.hpp>
48
49 namespace boost { namespace geometry
50 {
51
52 namespace srs { namespace par4
53 {
54 struct lask {};
55
56 }} //namespace srs::par4
57
58 namespace projections
59 {
60 #ifndef DOXYGEN_NO_DETAIL
61 namespace detail { namespace lask
62 {
63
64 static const double a10 = 0.975534;
65 static const double a12 = -0.119161;
66 static const double a32 = -0.0143059;
67 static const double a14 = -0.0547009;
68 static const double b01 = 1.00384;
69 static const double b21 = 0.0802894;
70 static const double b03 = 0.0998909;
71 static const double b41 = 0.000199025;
72 static const double b23 = -0.0285500;
73 static const double b05 = -0.0491032;
74
75 // template class, using CRTP to implement forward/inverse
76 template <typename CalculationType, typename Parameters>
77 struct base_lask_spheroid : public base_t_f<base_lask_spheroid<CalculationType, Parameters>,
78 CalculationType, Parameters>
79 {
80
81 typedef CalculationType geographic_type;
82 typedef CalculationType cartesian_type;
83
84
85 inline base_lask_spheroid(const Parameters& par)
86 : base_t_f<base_lask_spheroid<CalculationType, Parameters>,
87 CalculationType, Parameters>(*this, par) {}
88
89 // FORWARD(s_forward) sphere
90 // Project coordinates from geographic (lon, lat) to cartesian (x, y)
91 inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& xy_y) const
92 {
93 CalculationType l2, p2;
94
95 l2 = lp_lon * lp_lon;
96 p2 = lp_lat * lp_lat;
97 xy_x = lp_lon * (a10 + p2 * (a12 + l2 * a32 + p2 * a14));
98 xy_y = lp_lat * (b01 + l2 * (b21 + p2 * b23 + l2 * b41) +
99 p2 * (b03 + p2 * b05));
100 }
101
102 static inline std::string get_name()
103 {
104 return "lask_spheroid";
105 }
106
107 };
108
109 // Laskowski
110 template <typename Parameters>
111 inline void setup_lask(Parameters& par)
112 {
113 par.es = 0.;
114 }
115
116 }} // namespace detail::lask
117 #endif // doxygen
118
119 /*!
120 \brief Laskowski projection
121 \ingroup projections
122 \tparam Geographic latlong point type
123 \tparam Cartesian xy point type
124 \tparam Parameters parameter type
125 \par Projection characteristics
126 - Miscellaneous
127 - Spheroid
128 - no inverse
129 \par Example
130 \image html ex_lask.gif
131 */
132 template <typename CalculationType, typename Parameters>
133 struct lask_spheroid : public detail::lask::base_lask_spheroid<CalculationType, Parameters>
134 {
135 inline lask_spheroid(const Parameters& par) : detail::lask::base_lask_spheroid<CalculationType, Parameters>(par)
136 {
137 detail::lask::setup_lask(this->m_par);
138 }
139 };
140
141 #ifndef DOXYGEN_NO_DETAIL
142 namespace detail
143 {
144
145 // Static projection
146 BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PROJECTION(srs::par4::lask, lask_spheroid, lask_spheroid)
147
148 // Factory entry(s)
149 template <typename CalculationType, typename Parameters>
150 class lask_entry : public detail::factory_entry<CalculationType, Parameters>
151 {
152 public :
153 virtual base_v<CalculationType, Parameters>* create_new(const Parameters& par) const
154 {
155 return new base_v_f<lask_spheroid<CalculationType, Parameters>, CalculationType, Parameters>(par);
156 }
157 };
158
159 template <typename CalculationType, typename Parameters>
160 inline void lask_init(detail::base_factory<CalculationType, Parameters>& factory)
161 {
162 factory.add_to_factory("lask", new lask_entry<CalculationType, Parameters>);
163 }
164
165 } // namespace detail
166 #endif // doxygen
167
168 } // namespace projections
169
170 }} // namespace boost::geometry
171
172 #endif // BOOST_GEOMETRY_PROJECTIONS_LASK_HPP
173