123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192 |
- #ifndef BOOST_GEOMETRY_PROJECTIONS_PUTP4P_HPP
- #define BOOST_GEOMETRY_PROJECTIONS_PUTP4P_HPP
- #include <boost/geometry/srs/projections/impl/base_static.hpp>
- #include <boost/geometry/srs/projections/impl/base_dynamic.hpp>
- #include <boost/geometry/srs/projections/impl/projects.hpp>
- #include <boost/geometry/srs/projections/impl/factory_entry.hpp>
- #include <boost/geometry/srs/projections/impl/aasincos.hpp>
- namespace boost { namespace geometry
- {
- namespace projections
- {
- #ifndef DOXYGEN_NO_DETAIL
- namespace detail { namespace putp4p
- {
- template <typename T>
- struct par_putp4p
- {
- T C_x, C_y;
- };
- template <typename T, typename Parameters>
- struct base_putp4p_spheroid
- {
- par_putp4p<T> m_proj_parm;
-
-
- inline void fwd(Parameters const& , T const& lp_lon, T lp_lat, T& xy_x, T& xy_y) const
- {
- static T const third = detail::third<T>();
- lp_lat = aasin(0.883883476 * sin(lp_lat));
- xy_x = this->m_proj_parm.C_x * lp_lon * cos(lp_lat);
- xy_x /= cos(lp_lat *= third);
- xy_y = this->m_proj_parm.C_y * sin(lp_lat);
- }
-
-
- inline void inv(Parameters const& , T const& xy_x, T const& xy_y, T& lp_lon, T& lp_lat) const
- {
- lp_lat = aasin(xy_y / this->m_proj_parm.C_y);
- lp_lon = xy_x * cos(lp_lat) / this->m_proj_parm.C_x;
- lp_lat *= 3.;
- lp_lon /= cos(lp_lat);
- lp_lat = aasin(1.13137085 * sin(lp_lat));
- }
- static inline std::string get_name()
- {
- return "putp4p_spheroid";
- }
- };
-
- template <typename Parameters, typename T>
- inline void setup_putp4p(Parameters& par, par_putp4p<T>& proj_parm)
- {
- proj_parm.C_x = 0.874038744;
- proj_parm.C_y = 3.883251825;
- par.es = 0.;
- }
-
- template <typename Parameters, typename T>
- inline void setup_weren(Parameters& par, par_putp4p<T>& proj_parm)
- {
- proj_parm.C_x = 1.;
- proj_parm.C_y = 4.442882938;
- par.es = 0.;
- }
- }}
- #endif
-
- template <typename T, typename Parameters>
- struct putp4p_spheroid : public detail::putp4p::base_putp4p_spheroid<T, Parameters>
- {
- template <typename Params>
- inline putp4p_spheroid(Params const& , Parameters & par)
- {
- detail::putp4p::setup_putp4p(par, this->m_proj_parm);
- }
- };
-
- template <typename T, typename Parameters>
- struct weren_spheroid : public detail::putp4p::base_putp4p_spheroid<T, Parameters>
- {
- template <typename Params>
- inline weren_spheroid(Params const& , Parameters & par)
- {
- detail::putp4p::setup_weren(par, this->m_proj_parm);
- }
- };
- #ifndef DOXYGEN_NO_DETAIL
- namespace detail
- {
-
- BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PROJECTION_FI(srs::spar::proj_putp4p, putp4p_spheroid)
- BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PROJECTION_FI(srs::spar::proj_weren, weren_spheroid)
-
- BOOST_GEOMETRY_PROJECTIONS_DETAIL_FACTORY_ENTRY_FI(putp4p_entry, putp4p_spheroid)
- BOOST_GEOMETRY_PROJECTIONS_DETAIL_FACTORY_ENTRY_FI(weren_entry, weren_spheroid)
- BOOST_GEOMETRY_PROJECTIONS_DETAIL_FACTORY_INIT_BEGIN(putp4p_init)
- {
- BOOST_GEOMETRY_PROJECTIONS_DETAIL_FACTORY_INIT_ENTRY(putp4p, putp4p_entry)
- BOOST_GEOMETRY_PROJECTIONS_DETAIL_FACTORY_INIT_ENTRY(weren, weren_entry)
- }
- }
- #endif
- }
- }}
- #endif
|