1
// Generic Geometry Library - projections (based on PROJ4)
2
// This file is manually converted from PROJ4
4
// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
5
// Copyright Bruno Lalande 2008, 2009
6
// Use, modification and distribution is subject to the Boost Software License,
7
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
8
// http://www.boost.org/LICENSE_1_0.txt)
10
// This file is converted from PROJ4, http://trac.osgeo.org/proj
11
// PROJ4 is originally written by Gerald Evenden (then of the USGS)
12
// PROJ4 is maintained by Frank Warmerdam
13
// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
15
// Original copyright notice:
17
// Permission is hereby granted, free of charge, to any person obtaining a
18
// copy of this software and associated documentation files (the "Software"),
19
// to deal in the Software without restriction, including without limitation
20
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
21
// and/or sell copies of the Software, and to permit persons to whom the
22
// Software is furnished to do so, subject to the following conditions:
24
// The above copyright notice and this permission notice shall be included
25
// in all copies or substantial portions of the Software.
27
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
28
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
29
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
30
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
31
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
32
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
33
// DEALINGS IN THE SOFTWARE.
35
#ifndef GGL_PROJECTIONS_IMPL_PJ_AUTH_HPP
36
#define GGL_PROJECTIONS_IMPL_PJ_AUTH_HPP
41
namespace ggl { namespace projection { namespace detail {
43
static const double P00 = .33333333333333333333;
44
static const double P01 = .17222222222222222222;
45
static const double P02 = .10257936507936507936;
46
static const double P10 = .06388888888888888888;
47
static const double P11 = .06640211640211640211;
48
static const double P20 = .01641501294219154443;
49
static const int APA_SIZE = 3;
51
/* determine latitude from authalic latitude */
52
inline void pj_authset(double es, double* APA)
58
// if (APA = (double *)pj_malloc(APA_SIZE * sizeof(double)))
71
inline double pj_authlat(double beta, const double* APA)
75
const double t = beta + beta;
77
return(beta + APA[0] * std::sin(t) + APA[1] * std::sin(t + t) + APA[2] * std::sin(t + t + t));
80
}}} // namespace ggl::projection::impl
82
#endif // GGL_PROJECTIONS_IMPL_PJ_AUTH_HPP