src/AlbersEqualArea.cpp
Go to the documentation of this file.
1 
11 
12 #if defined(_MSC_VER)
13 // Squelch warnings about constant conditional expressions
14 # pragma warning (disable: 4127)
15 #endif
16 
17 namespace GeographicLib {
18 
19  using namespace std;
20 
22  : eps_(numeric_limits<real>::epsilon())
23  , epsx_(Math::sq(eps_))
24  , epsx2_(Math::sq(epsx_))
25  , tol_(sqrt(eps_))
26  , tol0_(tol_ * sqrt(sqrt(eps_)))
27  , _a(a)
28  , _f(f)
29  , _fm(1 - _f)
30  , _e2(_f * (2 - _f))
31  , _e(sqrt(abs(_e2)))
32  , _e2m(1 - _e2)
33  , _qZ(1 + _e2m * atanhee(real(1)))
34  , _qx(_qZ / ( 2 * _e2m ))
35  {
36  if (!(Math::isfinite(_a) && _a > 0))
37  throw GeographicErr("Equatorial radius is not positive");
38  if (!(Math::isfinite(_f) && _f < 1))
39  throw GeographicErr("Polar semi-axis is not positive");
40  if (!(Math::isfinite(k0) && k0 > 0))
41  throw GeographicErr("Scale is not positive");
42  if (!(abs(stdlat) <= 90))
43  throw GeographicErr("Standard latitude not in [-90d, 90d]");
44  real sphi, cphi;
45  Math::sincosd(stdlat, sphi, cphi);
46  Init(sphi, cphi, sphi, cphi, k0);
47  }
48 
50  real k1)
51  : eps_(numeric_limits<real>::epsilon())
52  , epsx_(Math::sq(eps_))
53  , epsx2_(Math::sq(epsx_))
54  , tol_(sqrt(eps_))
55  , tol0_(tol_ * sqrt(sqrt(eps_)))
56  , _a(a)
57  , _f(f)
58  , _fm(1 - _f)
59  , _e2(_f * (2 - _f))
60  , _e(sqrt(abs(_e2)))
61  , _e2m(1 - _e2)
62  , _qZ(1 + _e2m * atanhee(real(1)))
63  , _qx(_qZ / ( 2 * _e2m ))
64  {
65  if (!(Math::isfinite(_a) && _a > 0))
66  throw GeographicErr("Equatorial radius is not positive");
67  if (!(Math::isfinite(_f) && _f < 1))
68  throw GeographicErr("Polar semi-axis is not positive");
69  if (!(Math::isfinite(k1) && k1 > 0))
70  throw GeographicErr("Scale is not positive");
71  if (!(abs(stdlat1) <= 90))
72  throw GeographicErr("Standard latitude 1 not in [-90d, 90d]");
73  if (!(abs(stdlat2) <= 90))
74  throw GeographicErr("Standard latitude 2 not in [-90d, 90d]");
75  real sphi1, cphi1, sphi2, cphi2;
76  Math::sincosd(stdlat1, sphi1, cphi1);
77  Math::sincosd(stdlat2, sphi2, cphi2);
78  Init(sphi1, cphi1, sphi2, cphi2, k1);
79  }
80 
82  real sinlat1, real coslat1,
83  real sinlat2, real coslat2,
84  real k1)
85  : eps_(numeric_limits<real>::epsilon())
86  , epsx_(Math::sq(eps_))
87  , epsx2_(Math::sq(epsx_))
88  , tol_(sqrt(eps_))
89  , tol0_(tol_ * sqrt(sqrt(eps_)))
90  , _a(a)
91  , _f(f)
92  , _fm(1 - _f)
93  , _e2(_f * (2 - _f))
94  , _e(sqrt(abs(_e2)))
95  , _e2m(1 - _e2)
96  , _qZ(1 + _e2m * atanhee(real(1)))
97  , _qx(_qZ / ( 2 * _e2m ))
98  {
99  if (!(Math::isfinite(_a) && _a > 0))
100  throw GeographicErr("Equatorial radius is not positive");
101  if (!(Math::isfinite(_f) && _f < 1))
102  throw GeographicErr("Polar semi-axis is not positive");
103  if (!(Math::isfinite(k1) && k1 > 0))
104  throw GeographicErr("Scale is not positive");
105  if (!(coslat1 >= 0))
106  throw GeographicErr("Standard latitude 1 not in [-90d, 90d]");
107  if (!(coslat2 >= 0))
108  throw GeographicErr("Standard latitude 2 not in [-90d, 90d]");
109  if (!(abs(sinlat1) <= 1 && coslat1 <= 1) || (coslat1 == 0 && sinlat1 == 0))
110  throw GeographicErr("Bad sine/cosine of standard latitude 1");
111  if (!(abs(sinlat2) <= 1 && coslat2 <= 1) || (coslat2 == 0 && sinlat2 == 0))
112  throw GeographicErr("Bad sine/cosine of standard latitude 2");
113  if (coslat1 == 0 && coslat2 == 0 && sinlat1 * sinlat2 <= 0)
114  throw GeographicErr
115  ("Standard latitudes cannot be opposite poles");
116  Init(sinlat1, coslat1, sinlat2, coslat2, k1);
117  }
118 
119  void AlbersEqualArea::Init(real sphi1, real cphi1,
120  real sphi2, real cphi2, real k1) {
121  {
122  real r;
123  r = Math::hypot(sphi1, cphi1);
124  sphi1 /= r; cphi1 /= r;
125  r = Math::hypot(sphi2, cphi2);
126  sphi2 /= r; cphi2 /= r;
127  }
128  bool polar = (cphi1 == 0);
129  cphi1 = max(epsx_, cphi1); // Avoid singularities at poles
130  cphi2 = max(epsx_, cphi2);
131  // Determine hemisphere of tangent latitude
132  _sign = sphi1 + sphi2 >= 0 ? 1 : -1;
133  // Internally work with tangent latitude positive
134  sphi1 *= _sign; sphi2 *= _sign;
135  if (sphi1 > sphi2) {
136  swap(sphi1, sphi2); swap(cphi1, cphi2); // Make phi1 < phi2
137  }
138  real
139  tphi1 = sphi1/cphi1, tphi2 = sphi2/cphi2;
140 
141  // q = (1-e^2)*(sphi/(1-e^2*sphi^2) - atanhee(sphi))
142  // qZ = q(pi/2) = (1 + (1-e^2)*atanhee(1))
143  // atanhee(x) = atanh(e*x)/e
144  // q = sxi * qZ
145  // dq/dphi = 2*(1-e^2)*cphi/(1-e^2*sphi^2)^2
146  //
147  // n = (m1^2-m2^2)/(q2-q1) -> sin(phi0) for phi1, phi2 -> phi0
148  // C = m1^2 + n*q1 = (m1^2*q2-m2^2*q1)/(q2-q1)
149  // let
150  // rho(pi/2)/rho(-pi/2) = (1-s)/(1+s)
151  // s = n*qZ/C
152  // = qZ * (m1^2-m2^2)/(m1^2*q2-m2^2*q1)
153  // = qZ * (scbet2^2 - scbet1^2)/(scbet2^2*q2 - scbet1^2*q1)
154  // = (scbet2^2 - scbet1^2)/(scbet2^2*sxi2 - scbet1^2*sxi1)
155  // = (tbet2^2 - tbet1^2)/(scbet2^2*sxi2 - scbet1^2*sxi1)
156  // 1-s = -((1-sxi2)*scbet2^2 - (1-sxi1)*scbet1^2)/
157  // (scbet2^2*sxi2 - scbet1^2*sxi1)
158  //
159  // Define phi0 to give same value of s, i.e.,
160  // s = sphi0 * qZ / (m0^2 + sphi0*q0)
161  // = sphi0 * scbet0^2 / (1/qZ + sphi0 * scbet0^2 * sxi0)
162 
163  real tphi0, C;
164  if (polar || tphi1 == tphi2) {
165  tphi0 = tphi2;
166  C = 1; // ignored
167  } else {
168  real
169  tbet1 = _fm * tphi1, scbet12 = 1 + Math::sq(tbet1),
170  tbet2 = _fm * tphi2, scbet22 = 1 + Math::sq(tbet2),
171  txi1 = txif(tphi1), cxi1 = 1/hyp(txi1), sxi1 = txi1 * cxi1,
172  txi2 = txif(tphi2), cxi2 = 1/hyp(txi2), sxi2 = txi2 * cxi2,
173  dtbet2 = _fm * (tbet1 + tbet2),
174  es1 = 1 - _e2 * Math::sq(sphi1), es2 = 1 - _e2 * Math::sq(sphi2),
175  /*
176  dsxi = ( (_e2 * sq(sphi2 + sphi1) + es2 + es1) / (2 * es2 * es1) +
177  Datanhee(sphi2, sphi1) ) * Dsn(tphi2, tphi1, sphi2, sphi1) /
178  ( 2 * _qx ),
179  */
180  dsxi = ( (1 + _e2 * sphi1 * sphi2) / (es2 * es1) +
181  Datanhee(sphi2, sphi1) ) * Dsn(tphi2, tphi1, sphi2, sphi1) /
182  ( 2 * _qx ),
183  den = (sxi2 + sxi1) * dtbet2 + (scbet22 + scbet12) * dsxi,
184  // s = (sq(tbet2) - sq(tbet1)) / (scbet22*sxi2 - scbet12*sxi1)
185  s = 2 * dtbet2 / den,
186  // 1-s = -(sq(scbet2)*(1-sxi2) - sq(scbet1)*(1-sxi1)) /
187  // (scbet22*sxi2 - scbet12*sxi1)
188  // Write
189  // sq(scbet)*(1-sxi) = sq(scbet)*(1-sphi) * (1-sxi)/(1-sphi)
190  sm1 = -Dsn(tphi2, tphi1, sphi2, sphi1) *
191  ( -( ((sphi2 <= 0 ? (1 - sxi2) / (1 - sphi2) :
192  Math::sq(cxi2/cphi2) * (1 + sphi2) / (1 + sxi2)) +
193  (sphi1 <= 0 ? (1 - sxi1) / (1 - sphi1) :
194  Math::sq(cxi1/cphi1) * (1 + sphi1) / (1 + sxi1))) ) *
195  (1 + _e2 * (sphi1 + sphi2 + sphi1 * sphi2)) /
196  (1 + (sphi1 + sphi2 + sphi1 * sphi2)) +
197  (scbet22 * (sphi2 <= 0 ? 1 - sphi2 :
198  Math::sq(cphi2) / ( 1 + sphi2)) +
199  scbet12 * (sphi1 <= 0 ? 1 - sphi1 : Math::sq(cphi1) / ( 1 + sphi1)))
200  * (_e2 * (1 + sphi1 + sphi2 + _e2 * sphi1 * sphi2)/(es1 * es2)
201  +_e2m * DDatanhee(sphi1, sphi2) ) / _qZ ) / den;
202  // C = (scbet22*sxi2 - scbet12*sxi1) / (scbet22 * scbet12 * (sx2 - sx1))
203  C = den / (2 * scbet12 * scbet22 * dsxi);
204  tphi0 = (tphi2 + tphi1)/2;
205  real stol = tol0_ * max(real(1), abs(tphi0));
206  for (int i = 0; i < 2*numit0_ || GEOGRAPHICLIB_PANIC; ++i) {
207  // Solve (scbet0^2 * sphi0) / (1/qZ + scbet0^2 * sphi0 * sxi0) = s
208  // for tphi0 by Newton's method on
209  // v(tphi0) = (scbet0^2 * sphi0) - s * (1/qZ + scbet0^2 * sphi0 * sxi0)
210  // = 0
211  // Alt:
212  // (scbet0^2 * sphi0) / (1/qZ - scbet0^2 * sphi0 * (1-sxi0))
213  // = s / (1-s)
214  // w(tphi0) = (1-s) * (scbet0^2 * sphi0)
215  // - s * (1/qZ - scbet0^2 * sphi0 * (1-sxi0))
216  // = (1-s) * (scbet0^2 * sphi0)
217  // - S/qZ * (1 - scbet0^2 * sphi0 * (qZ-q0))
218  // Now
219  // qZ-q0 = (1+e2*sphi0)*(1-sphi0)/(1-e2*sphi0^2) +
220  // (1-e2)*atanhee((1-sphi0)/(1-e2*sphi0))
221  // In limit sphi0 -> 1, qZ-q0 -> 2*(1-sphi0)/(1-e2), so wrte
222  // qZ-q0 = 2*(1-sphi0)/(1-e2) + A + B
223  // A = (1-sphi0)*( (1+e2*sphi0)/(1-e2*sphi0^2) - (1+e2)/(1-e2) )
224  // = -e2 *(1-sphi0)^2 * (2+(1+e2)*sphi0) / ((1-e2)*(1-e2*sphi0^2))
225  // B = (1-e2)*atanhee((1-sphi0)/(1-e2*sphi0)) - (1-sphi0)
226  // = (1-sphi0)*(1-e2)/(1-e2*sphi0)*
227  // ((atanhee(x)/x-1) - e2*(1-sphi0)/(1-e2))
228  // x = (1-sphi0)/(1-e2*sphi0), atanhee(x)/x = atanh(e*x)/(e*x)
229  //
230  // 1 - scbet0^2 * sphi0 * (qZ-q0)
231  // = 1 - scbet0^2 * sphi0 * (2*(1-sphi0)/(1-e2) + A + B)
232  // = D - scbet0^2 * sphi0 * (A + B)
233  // D = 1 - scbet0^2 * sphi0 * 2*(1-sphi0)/(1-e2)
234  // = (1-sphi0)*(1-e2*(1+2*sphi0*(1+sphi0)))/((1-e2)*(1+sphi0))
235  // dD/dsphi0 = -2*(1-e2*sphi0^2*(2*sphi0+3))/((1-e2)*(1+sphi0)^2)
236  // d(A+B)/dsphi0 = 2*(1-sphi0^2)*e2*(2-e2*(1+sphi0^2))/
237  // ((1-e2)*(1-e2*sphi0^2)^2)
238 
239  real
240  scphi02 = 1 + Math::sq(tphi0), scphi0 = sqrt(scphi02),
241  // sphi0m = 1-sin(phi0) = 1/( sec(phi0) * (tan(phi0) + sec(phi0)) )
242  sphi0 = tphi0 / scphi0, sphi0m = 1/(scphi0 * (tphi0 + scphi0)),
243  // scbet0^2 * sphi0
244  g = (1 + Math::sq( _fm * tphi0 )) * sphi0,
245  // dg/dsphi0 = dg/dtphi0 * scphi0^3
246  dg = _e2m * scphi02 * (1 + 2 * Math::sq(tphi0)) + _e2,
247  D = sphi0m * (1 - _e2*(1 + 2*sphi0*(1+sphi0))) / (_e2m * (1+sphi0)),
248  // dD/dsphi0
249  dD = -2 * (1 - _e2*Math::sq(sphi0) * (2*sphi0+3)) /
250  (_e2m * Math::sq(1+sphi0)),
251  A = -_e2 * Math::sq(sphi0m) * (2+(1+_e2)*sphi0) /
252  (_e2m*(1-_e2*Math::sq(sphi0))),
253  B = (sphi0m * _e2m / (1 - _e2*sphi0) *
254  (atanhxm1(_e2 *
255  Math::sq(sphi0m / (1-_e2*sphi0))) - _e2*sphi0m/_e2m)),
256  // d(A+B)/dsphi0
257  dAB = (2 * _e2 * (2 - _e2 * (1 + Math::sq(sphi0))) /
258  (_e2m * Math::sq(1 - _e2*Math::sq(sphi0)) * scphi02)),
259  u = sm1 * g - s/_qZ * ( D - g * (A + B) ),
260  // du/dsphi0
261  du = sm1 * dg - s/_qZ * (dD - dg * (A + B) - g * dAB),
262  dtu = -u/du * (scphi0 * scphi02);
263  tphi0 += dtu;
264  if (!(abs(dtu) >= stol))
265  break;
266  }
267  }
268  _txi0 = txif(tphi0); _scxi0 = hyp(_txi0); _sxi0 = _txi0 / _scxi0;
269  _n0 = tphi0/hyp(tphi0);
270  _m02 = 1 / (1 + Math::sq(_fm * tphi0));
271  _nrho0 = polar ? 0 : _a * sqrt(_m02);
272  _k0 = sqrt(tphi1 == tphi2 ? 1 : C / (_m02 + _n0 * _qZ * _sxi0)) * k1;
273  _k2 = Math::sq(_k0);
274  _lat0 = _sign * atan(tphi0)/Math::degree();
275  }
276 
278  static const AlbersEqualArea
279  cylindricalequalarea(Constants::WGS84_a(), Constants::WGS84_f(),
280  real(0), real(1), real(0), real(1), real(1));
281  return cylindricalequalarea;
282  }
283 
285  static const AlbersEqualArea
286  azimuthalequalareanorth(Constants::WGS84_a(), Constants::WGS84_f(),
287  real(1), real(0), real(1), real(0), real(1));
288  return azimuthalequalareanorth;
289  }
290 
292  static const AlbersEqualArea
293  azimuthalequalareasouth(Constants::WGS84_a(), Constants::WGS84_f(),
294  real(-1), real(0), real(-1), real(0), real(1));
295  return azimuthalequalareasouth;
296  }
297 
299  // sxi = ( sphi/(1-e2*sphi^2) + atanhee(sphi) ) /
300  // ( 1/(1-e2) + atanhee(1) )
301  //
302  // txi = ( sphi/(1-e2*sphi^2) + atanhee(sphi) ) /
303  // sqrt( ( (1+e2*sphi)*(1-sphi)/( (1-e2*sphi^2) * (1-e2) ) +
304  // atanhee((1-sphi)/(1-e2*sphi)) ) *
305  // ( (1-e2*sphi)*(1+sphi)/( (1-e2*sphi^2) * (1-e2) ) +
306  // atanhee((1+sphi)/(1+e2*sphi)) ) )
307  //
308  // subst 1-sphi = cphi^2/(1+sphi)
309  int s = tphi < 0 ? -1 : 1; // Enforce odd parity
310  tphi *= s;
311  real
312  cphi2 = 1 / (1 + Math::sq(tphi)),
313  sphi = tphi * sqrt(cphi2),
314  es1 = _e2 * sphi,
315  es2m1 = 1 - es1 * sphi,
316  sp1 = 1 + sphi,
317  es1m1 = (1 - es1) * sp1,
318  es2m1a = _e2m * es2m1,
319  es1p1 = sp1 / (1 + es1);
320  return s * ( sphi / es2m1 + atanhee(sphi) ) /
321  sqrt( ( cphi2 / (es1p1 * es2m1a) + atanhee(cphi2 / es1m1) ) *
322  ( es1m1 / es2m1a + atanhee(es1p1) ) );
323  }
324 
326  real
327  tphi = txi,
328  stol = tol_ * max(real(1), abs(txi));
329  // CHECK: min iterations = 1, max iterations = 2; mean = 1.99
330  for (int i = 0; i < numit_ || GEOGRAPHICLIB_PANIC; ++i) {
331  // dtxi/dtphi = (scxi/scphi)^3 * 2*(1-e^2)/(qZ*(1-e^2*sphi^2)^2)
332  real
333  txia = txif(tphi),
334  tphi2 = Math::sq(tphi),
335  scphi2 = 1 + tphi2,
336  scterm = scphi2/(1 + Math::sq(txia)),
337  dtphi = (txi - txia) * scterm * sqrt(scterm) *
338  _qx * Math::sq(1 - _e2 * tphi2 / scphi2);
339  tphi += dtphi;
340  if (!(abs(dtphi) >= stol))
341  break;
342  }
343  return tphi;
344  }
345 
346  // return atanh(sqrt(x))/sqrt(x) - 1 = y/3 + y^2/5 + y^3/7 + ...
347  // typical x < e^2 = 2*f
349  real s = 0;
350  if (abs(x) < real(0.5)) {
351  real os = -1, y = 1, k = 1;
352  while (os != s) {
353  os = s;
354  y *= x; // y = x^n
355  k += 2; // k = 2*n + 1
356  s += y/k; // sum( x^n/(2*n + 1) )
357  }
358  } else {
359  real xs = sqrt(abs(x));
360  s = (x > 0 ? Math::atanh(xs) : atan(xs)) / xs - 1;
361  }
362  return s;
363  }
364 
365  // return (Datanhee(1,y) - Datanhee(1,x))/(y-x)
367  real s = 0;
368  if (_e2 * (abs(x) + abs(y)) < real(0.5)) {
369  real os = -1, z = 1, k = 1, t = 0, c = 0, en = 1;
370  while (os != s) {
371  os = s;
372  t = y * t + z; c += t; z *= x;
373  t = y * t + z; c += t; z *= x;
374  k += 2; en *= _e2;
375  // Here en[l] = e2^l, k[l] = 2*l + 1,
376  // c[l] = sum( x^i * y^j; i >= 0, j >= 0, i+j < 2*l)
377  s += en * c / k;
378  }
379  // Taylor expansion is
380  // s = sum( c[l] * e2^l / (2*l + 1), l, 1, N)
381  } else
382  s = (Datanhee(1, y) - Datanhee(x, y))/(1 - x);
383  return s;
384  }
385 
387  real& x, real& y, real& gamma, real& k) const {
388  lon = Math::AngDiff(lon0, lon);
389  lat *= _sign;
390  real sphi, cphi;
391  Math::sincosd(Math::LatFix(lat) * _sign, sphi, cphi);
392  cphi = max(epsx_, cphi);
393  real
394  lam = lon * Math::degree(),
395  tphi = sphi/cphi, txi = txif(tphi), sxi = txi/hyp(txi),
396  dq = _qZ * Dsn(txi, _txi0, sxi, _sxi0) * (txi - _txi0),
397  drho = - _a * dq / (sqrt(_m02 - _n0 * dq) + _nrho0 / _a),
398  theta = _k2 * _n0 * lam, stheta = sin(theta), ctheta = cos(theta),
399  t = _nrho0 + _n0 * drho;
400  x = t * (_n0 != 0 ? stheta / _n0 : _k2 * lam) / _k0;
401  y = (_nrho0 *
402  (_n0 != 0 ?
403  (ctheta < 0 ? 1 - ctheta : Math::sq(stheta)/(1 + ctheta)) / _n0 :
404  0)
405  - drho * ctheta) / _k0;
406  k = _k0 * (t != 0 ? t * hyp(_fm * tphi) / _a : 1);
407  y *= _sign;
408  gamma = _sign * theta / Math::degree();
409  }
410 
412  real& lat, real& lon,
413  real& gamma, real& k) const {
414  y *= _sign;
415  real
416  nx = _k0 * _n0 * x, ny = _k0 * _n0 * y, y1 = _nrho0 - ny,
417  den = Math::hypot(nx, y1) + _nrho0, // 0 implies origin with polar aspect
418  drho = den != 0 ? (_k0*x*nx - 2*_k0*y*_nrho0 + _k0*y*ny) / den : 0,
419  // dsxia = scxi0 * dsxi
420  dsxia = - _scxi0 * (2 * _nrho0 + _n0 * drho) * drho /
421  (Math::sq(_a) * _qZ),
422  txi = (_txi0 + dsxia) / sqrt(max(1 - dsxia * (2*_txi0 + dsxia), epsx2_)),
423  tphi = tphif(txi),
424  theta = atan2(nx, y1),
425  lam = _n0 != 0 ? theta / (_k2 * _n0) : x / (y1 * _k0);
426  gamma = _sign * theta / Math::degree();
427  lat = Math::atand(_sign * tphi);
428  lon = lam / Math::degree();
429  lon = Math::AngNormalize(lon + Math::AngNormalize(lon0));
430  k = _k0 * (den != 0 ? (_nrho0 + _n0 * drho) * hyp(_fm * tphi) / _a : 1);
431  }
432 
434  if (!(Math::isfinite(k) && k > 0))
435  throw GeographicErr("Scale is not positive");
436  if (!(abs(lat) < 90))
437  throw GeographicErr("Latitude for SetScale not in (-90d, 90d)");
438  real x, y, gamma, kold;
439  Forward(0, lat, 0, x, y, gamma, kold);
440  k /= kold;
441  _k0 *= k;
442  _k2 = Math::sq(_k0);
443  }
444 
445 } // namespace GeographicLib
static T AngNormalize(T x)
Definition: Math.hpp:440
Matrix< SCALARB, Dynamic, Dynamic, opt_B > B
Definition: bench_gemm.cpp:49
static real Dsn(real x, real y, real sx, real sy)
#define max(a, b)
Definition: datatypes.h:20
Jet< T, N > cos(const Jet< T, N > &f)
Definition: jet.h:426
Scalar * y
real Datanhee(real x, real y) const
static T atand(T x)
Definition: Math.hpp:723
static const double lat
AlbersEqualArea(real a, real f, real stdlat, real k0)
static bool isfinite(T x)
Definition: Math.hpp:806
static const AlbersEqualArea & CylindricalEqualArea()
static T LatFix(T x)
Definition: Math.hpp:467
Scalar Scalar * c
Definition: benchVecAdd.cpp:17
Jet< T, N > sin(const Jet< T, N > &f)
Definition: jet.h:439
Mathematical functions needed by GeographicLib.
Definition: Math.hpp:102
Definition: BFloat16.h:88
static void sincosd(T x, T &sinx, T &cosx)
Definition: Math.hpp:558
static T AngDiff(T x, T y, T &e)
Definition: Math.hpp:486
static T atanh(T x)
Definition: Math.hpp:328
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
Definition: bench_gemm.cpp:48
void g(const string &key, int i)
Definition: testBTree.cpp:41
static double epsilon
Definition: testRot3.cpp:37
EIGEN_DEVICE_FUNC const AtanReturnType atan() const
Header for GeographicLib::AlbersEqualArea class.
Albers equal area conic projection.
int EIGEN_BLAS_FUNC() swap(int *n, RealScalar *px, int *incx, RealScalar *py, int *incy)
Definition: level1_impl.h:130
static T hypot(T x, T y)
Definition: Math.hpp:243
void Forward(real lon0, real lat, real lon, real &x, real &y, real &gamma, real &k) const
static const AlbersEqualArea & AzimuthalEqualAreaNorth()
static T sq(T x)
Definition: Math.hpp:232
Definition: main.h:100
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Namespace for GeographicLib.
RealScalar s
const double lon0
static T degree()
Definition: Math.hpp:216
AnnoyingScalar atan2(const AnnoyingScalar &y, const AnnoyingScalar &x)
Matrix< Scalar, Dynamic, Dynamic > C
Definition: bench_gemm.cpp:50
void Init(real sphi1, real cphi1, real sphi2, real cphi2, real k1)
Exception handling for GeographicLib.
Definition: Constants.hpp:389
ofstream os("timeSchurFactors.csv")
static const AlbersEqualArea & AzimuthalEqualAreaSouth()
real DDatanhee(real x, real y) const
void Reverse(real lon0, real x, real y, real &lat, real &lon, real &gamma, real &k) const
static const double lon
Jet< T, N > sqrt(const Jet< T, N > &f)
Definition: jet.h:418
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
#define abs(x)
Definition: datatypes.h:17
Point2 t(10, 10)
#define GEOGRAPHICLIB_PANIC
Definition: Math.hpp:87
void SetScale(real lat, real k=real(1))


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:33:53