10 #if !defined(GEOGRAPHICLIB_LAMBERTCONFORMALCONIC_HPP)
11 #define GEOGRAPHICLIB_LAMBERTCONFORMALCONIC_HPP 1
66 real eps_, epsx_, ahypover_;
67 real _a, _f, _fm, _e2, _es;
68 real _sign, _n, _nc, _t0nm1, _scale, _lat0, _k0;
69 real _scbet0, _tchi0, _scchi0, _psi0, _nrho0, _drhomax;
70 static const int numit_ = 5;
89 static real Dhyp(real x, real y, real hx, real hy)
91 {
return (x + y) / (hx + hy); }
93 static real Dsn(real x, real y, real sx, real sy) {
96 return t > 0 ? (x + y) *
Math::sq( (sx * sy)/t ) / (sx + sy) :
97 (x - y != 0 ? (sx - sy) / (x - y) : 1);
100 static real Dlog1p(real x, real y) {
101 real t = x - y;
if (t < 0) { t = -t; y = x; }
102 return t != 0 ?
Math::log1p(t / (1 + y)) / t : 1 / (1 + x);
105 static real Dexp(real x, real y) {
106 using std::sinh;
using std::exp;
108 return (t != 0 ? sinh(t)/t : 1) * exp((x + y)/2);
114 static real Dsinh(real x, real y, real sx, real sy, real cx, real cy)
119 using std::sinh;
using std::sqrt;
121 return (t != 0 ? sinh(t)/t : 1) * sqrt((sx * sy + cx * cy + 1) /2);
125 static real Dasinh(real x, real y, real hx, real hy) {
129 Math::asinh(x*y > 0 ? t * (x + y) / (x*hy + y*hx) : x*hy - y*hx) / t :
133 real Deatanhe(real x, real y)
const {
134 real t = x - y, d = 1 - _e2 * x * y;
137 void Init(real sphi1, real cphi1, real sphi2, real cphi2, real k1);
201 real sinlat1, real coslat1,
202 real sinlat2, real coslat2,
214 void SetScale(real lat, real k =
real(1));
235 void Forward(real lon0, real lat, real lon,
236 real& x, real& y, real& gamma, real& k)
const;
255 void Reverse(real lon0, real x, real y,
256 real& lat, real& lon, real& gamma, real& k)
const;
263 real& x, real& y)
const {
265 Forward(lon0, lat, lon, x, y, gamma, k);
273 real& lat, real& lon)
const {
275 Reverse(lon0, x, y, lat, lon, gamma, k);
325 #endif // GEOGRAPHICLIB_LAMBERTCONFORMALCONIC_HPP