10 #if !defined(GEOGRAPHICLIB_LAMBERTCONFORMALCONIC_HPP)
11 #define GEOGRAPHICLIB_LAMBERTCONFORMALCONIC_HPP 1
15 namespace GeographicLib {
60 real eps_, epsx_, tol_, ahypover_;
61 real _a, _f, _fm, _e2, _e, _e2m;
62 real _sign, _n, _nc, _t0nm1, _scale, _lat0, _k0;
63 real _scbet0, _tchi0, _scchi0, _psi0, _nrho0, _drhomax;
64 static const int numit_ = 5;
68 inline real eatanhe(real x)
const {
70 return _f >= 0 ? _e *
Math::atanh(_e * x) : - _e * atan(_e * x);
89 static inline real Dhyp(real x, real y, real hx, real hy)
91 {
return (x + y) / (hx + hy); }
93 static inline 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 inline real Dlog1p(real x, real y) {
101 real t = x - y;
if (t < 0) { t = -t; y = x; }
102 return t ?
Math::log1p(t / (1 + y)) / t : 1 / (1 + x);
105 static inline real Dexp(real x, real y) {
106 using std::sinh;
using std::exp;
108 return (t ? sinh(t)/t : 1) * exp((x + y)/2);
114 static inline real Dsinh(real x, real y, real sx, real sy, real cx, real cy)
119 using std::sinh;
using std::sqrt;
121 return (t ? sinh(t)/t : 1) * sqrt((sx * sy + cx * cy + 1) /2);
125 static inline 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 inline real Deatanhe(real x, real y)
const {
134 real t = x - y, d = 1 - _e2 * x * y;
135 return t ? eatanhe(t / d) / t : _e2 / d;
137 void Init(real sphi1, real cphi1, real sphi2, real cphi2, real k1);
204 real sinlat1, real coslat1,
205 real sinlat2, real coslat2,
217 void SetScale(real lat, real k =
real(1));
239 void Forward(real lon0, real lat, real lon,
240 real& x, real& y, real& gamma, real& k)
const;
261 void Reverse(real lon0, real x, real y,
262 real& lat, real& lon, real& gamma, real& k)
const;
268 void Forward(real lon0, real lat, real lon,
269 real& x, real& y)
const {
271 Forward(lon0, lat, lon, x, y, gamma, k);
278 void Reverse(real lon0, real x, real y,
279 real& lat, real& lon)
const {
281 Reverse(lon0, x, y, lat, lon, gamma, k);
304 Math::real InverseFlattening()
const {
return 1/_f; }
333 #endif // GEOGRAPHICLIB_LAMBERTCONFORMALCONIC_HPP