Warning, file /include/boost/geometry/srs/projections/proj/fahey.hpp was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040 #ifndef BOOST_GEOMETRY_PROJECTIONS_FAHEY_HPP
0041 #define BOOST_GEOMETRY_PROJECTIONS_FAHEY_HPP
0042
0043 #include <boost/geometry/srs/projections/impl/base_static.hpp>
0044 #include <boost/geometry/srs/projections/impl/base_dynamic.hpp>
0045 #include <boost/geometry/srs/projections/impl/projects.hpp>
0046 #include <boost/geometry/srs/projections/impl/factory_entry.hpp>
0047 #include <boost/geometry/srs/projections/impl/aasincos.hpp>
0048
0049 namespace boost { namespace geometry
0050 {
0051
0052 namespace projections
0053 {
0054 #ifndef DOXYGEN_NO_DETAIL
0055 namespace detail { namespace fahey
0056 {
0057
0058 static const double tolerance = 1e-6;
0059
0060 template <typename T, typename Parameters>
0061 struct base_fahey_spheroid
0062 {
0063
0064
0065 inline void fwd(Parameters const& , T const& lp_lon, T const& lp_lat, T& xy_x, T& xy_y) const
0066 {
0067 xy_x = tan(0.5 * lp_lat);
0068 xy_y = 1.819152 * xy_x;
0069 xy_x = 0.819152 * lp_lon * asqrt(1 - xy_x * xy_x);
0070 }
0071
0072
0073
0074 inline void inv(Parameters const& , T const& xy_x, T xy_y, T& lp_lon, T& lp_lat) const
0075 {
0076 xy_y /= 1.819152;
0077 lp_lat = 2. * atan(xy_y);
0078 xy_y = 1. - xy_y * xy_y;
0079 lp_lon = fabs(xy_y) < tolerance ? 0. : xy_x / (0.819152 * sqrt(xy_y));
0080 }
0081
0082 static inline std::string get_name()
0083 {
0084 return "fahey_spheroid";
0085 }
0086
0087 };
0088
0089
0090 template <typename Parameters>
0091 inline void setup_fahey(Parameters& par)
0092 {
0093 par.es = 0.;
0094 }
0095
0096 }}
0097 #endif
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107
0108
0109
0110
0111 template <typename T, typename Parameters>
0112 struct fahey_spheroid : public detail::fahey::base_fahey_spheroid<T, Parameters>
0113 {
0114 template <typename Params>
0115 inline fahey_spheroid(Params const& , Parameters & par)
0116 {
0117 detail::fahey::setup_fahey(par);
0118 }
0119 };
0120
0121 #ifndef DOXYGEN_NO_DETAIL
0122 namespace detail
0123 {
0124
0125
0126 BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PROJECTION_FI(srs::spar::proj_fahey, fahey_spheroid)
0127
0128
0129 BOOST_GEOMETRY_PROJECTIONS_DETAIL_FACTORY_ENTRY_FI(fahey_entry, fahey_spheroid)
0130
0131 BOOST_GEOMETRY_PROJECTIONS_DETAIL_FACTORY_INIT_BEGIN(fahey_init)
0132 {
0133 BOOST_GEOMETRY_PROJECTIONS_DETAIL_FACTORY_INIT_ENTRY(fahey, fahey_entry);
0134 }
0135
0136 }
0137 #endif
0138
0139 }
0140
0141 }}
0142
0143 #endif
0144