123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- #ifndef BOOST_GEOMETRY_PROJECTIONS_IMPL_PJ_AUTH_HPP
- #define BOOST_GEOMETRY_PROJECTIONS_IMPL_PJ_AUTH_HPP
- #include <cassert>
- #include <cmath>
- #include <boost/geometry/core/assert.hpp>
- namespace boost { namespace geometry { namespace projections {
- namespace detail {
- template <typename T>
- struct apa
- {
- static const std::size_t size = 3;
- T const& operator[](size_t i) const { return data[i]; }
- T & operator[](size_t i) { return data[i]; }
- private:
- T data[3];
- };
- template <typename T>
- inline detail::apa<T> pj_authset(T const& es)
- {
- static const T P00 = .33333333333333333333;
- static const T P01 = .17222222222222222222;
- static const T P02 = .10257936507936507936;
- static const T P10 = .06388888888888888888;
- static const T P11 = .06640211640211640211;
- static const T P20 = .01641501294219154443;
- T t = 0;
- detail::apa<T> apa;
- {
- apa[0] = es * P00;
- t = es * es;
- apa[0] += t * P01;
- apa[1] = t * P10;
- t *= es;
- apa[0] += t * P02;
- apa[1] += t * P11;
- apa[2] = t * P20;
- }
- return apa;
- }
- template <typename T>
- inline T pj_authlat(T const& beta, detail::apa<T> const& apa)
- {
- T const t = beta + beta;
- return(beta + apa[0] * sin(t) + apa[1] * sin(t + t) + apa[2] * sin(t + t + t));
- }
- }
- }}}
- #endif
|