1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- #ifndef BOOST_GEOMETRY_PROJECTIONS_PJ_QSFN_HPP
- #define BOOST_GEOMETRY_PROJECTIONS_PJ_QSFN_HPP
- namespace boost { namespace geometry { namespace projections
- {
- namespace detail {
- template <typename T>
- inline T pj_qsfn(T const& sinphi, T const& e, T const& one_es)
- {
- static const T EPSILON = 1.0e-7;
- if (e >= EPSILON)
- {
- T con = e * sinphi;
- return (one_es * (sinphi / (1. - con * con) -
- (.5 / e) * log ((1. - con) / (1. + con))));
- } else
- return (sinphi + sinphi);
- }
- static const int MAX_C = 9;
- template <typename T>
- struct AUTHALIC
- {
- T C[MAX_C], CP[MAX_C], CQ[MAX_C];
- };
- template <typename T>
- inline T proj_qsfn(T const& phi, AUTHALIC<T> const& a)
- {
- T s, s2, sum;
- int i = MAX_C;
- s = sin(phi);
- s2 = s * s;
- sum = a.CQ[MAX_C - 1];
- while (--i) sum = a.CQ[i] + s2 * sum;
- return(s * sum);
- }
- }
- }}}
- #endif
|