GeodesicLineExact.hpp
Go to the documentation of this file.
1 
10 #if !defined(GEOGRAPHICLIB_GEODESICLINEEXACT_HPP)
11 #define GEOGRAPHICLIB_GEODESICLINEEXACT_HPP 1
12 
16 
17 namespace GeographicLib {
18 
36  private:
37  typedef Math::real real;
38  friend class GeodesicExact;
39  static const int nC4_ = GeodesicExact::nC4_;
40 
41  real tiny_;
42  real _lat1, _lon1, _azi1;
43  real _a, _f, _b, _c2, _f1, _e2, _salp0, _calp0, _k2,
44  _salp1, _calp1, _ssig1, _csig1, _dn1, _stau1, _ctau1,
45  _somg1, _comg1, _cchi1,
46  _A4, _B41, _E0, _D0, _H0, _E1, _D1, _H1;
47  real _a13, _s13;
48  real _C4a[nC4_]; // all the elements of _C4a are used
50  unsigned _caps;
51 
52  void LineInit(const GeodesicExact& g,
53  real lat1, real lon1,
54  real azi1, real salp1, real calp1,
55  unsigned caps);
57  real lat1, real lon1,
58  real azi1, real salp1, real calp1,
59  unsigned caps, bool arcmode, real s13_a13);
60 
61  enum captype {
71  };
72  public:
73 
81  enum mask {
142  };
143 
146 
187  GeodesicLineExact(const GeodesicExact& g, real lat1, real lon1, real azi1,
188  unsigned caps = ALL);
189 
197  GeodesicLineExact() : _caps(0U) {}
199 
202 
244  real& lat2, real& lon2, real& azi2,
245  real& m12, real& M12, real& M21,
246  real& S12) const {
247  real t;
248  return GenPosition(false, s12,
249  LATITUDE | LONGITUDE | AZIMUTH |
250  REDUCEDLENGTH | GEODESICSCALE | AREA,
251  lat2, lon2, azi2, t, m12, M12, M21, S12);
252  }
253 
257  Math::real Position(real s12, real& lat2, real& lon2) const {
258  real t;
259  return GenPosition(false, s12,
260  LATITUDE | LONGITUDE,
261  lat2, lon2, t, t, t, t, t, t);
262  }
263 
267  Math::real Position(real s12, real& lat2, real& lon2,
268  real& azi2) const {
269  real t;
270  return GenPosition(false, s12,
271  LATITUDE | LONGITUDE | AZIMUTH,
272  lat2, lon2, azi2, t, t, t, t, t);
273  }
274 
278  Math::real Position(real s12, real& lat2, real& lon2,
279  real& azi2, real& m12) const {
280  real t;
281  return GenPosition(false, s12,
282  LATITUDE | LONGITUDE |
283  AZIMUTH | REDUCEDLENGTH,
284  lat2, lon2, azi2, t, m12, t, t, t);
285  }
286 
290  Math::real Position(real s12, real& lat2, real& lon2,
291  real& azi2, real& M12, real& M21)
292  const {
293  real t;
294  return GenPosition(false, s12,
295  LATITUDE | LONGITUDE |
296  AZIMUTH | GEODESICSCALE,
297  lat2, lon2, azi2, t, t, M12, M21, t);
298  }
299 
304  real& lat2, real& lon2, real& azi2,
305  real& m12, real& M12, real& M21)
306  const {
307  real t;
308  return GenPosition(false, s12,
309  LATITUDE | LONGITUDE | AZIMUTH |
310  REDUCEDLENGTH | GEODESICSCALE,
311  lat2, lon2, azi2, t, m12, M12, M21, t);
312  }
314 
317 
356  void ArcPosition(real a12, real& lat2, real& lon2, real& azi2,
357  real& s12, real& m12, real& M12, real& M21,
358  real& S12) const {
359  GenPosition(true, a12,
360  LATITUDE | LONGITUDE | AZIMUTH | DISTANCE |
361  REDUCEDLENGTH | GEODESICSCALE | AREA,
362  lat2, lon2, azi2, s12, m12, M12, M21, S12);
363  }
364 
368  void ArcPosition(real a12, real& lat2, real& lon2)
369  const {
370  real t;
371  GenPosition(true, a12,
372  LATITUDE | LONGITUDE,
373  lat2, lon2, t, t, t, t, t, t);
374  }
375 
379  void ArcPosition(real a12,
380  real& lat2, real& lon2, real& azi2)
381  const {
382  real t;
383  GenPosition(true, a12,
384  LATITUDE | LONGITUDE | AZIMUTH,
385  lat2, lon2, azi2, t, t, t, t, t);
386  }
387 
391  void ArcPosition(real a12, real& lat2, real& lon2, real& azi2,
392  real& s12) const {
393  real t;
394  GenPosition(true, a12,
395  LATITUDE | LONGITUDE | AZIMUTH | DISTANCE,
396  lat2, lon2, azi2, s12, t, t, t, t);
397  }
398 
402  void ArcPosition(real a12, real& lat2, real& lon2, real& azi2,
403  real& s12, real& m12) const {
404  real t;
405  GenPosition(true, a12,
406  LATITUDE | LONGITUDE | AZIMUTH |
407  DISTANCE | REDUCEDLENGTH,
408  lat2, lon2, azi2, s12, m12, t, t, t);
409  }
410 
414  void ArcPosition(real a12, real& lat2, real& lon2, real& azi2,
415  real& s12, real& M12, real& M21)
416  const {
417  real t;
418  GenPosition(true, a12,
419  LATITUDE | LONGITUDE | AZIMUTH |
420  DISTANCE | GEODESICSCALE,
421  lat2, lon2, azi2, s12, t, M12, M21, t);
422  }
423 
427  void ArcPosition(real a12, real& lat2, real& lon2, real& azi2,
428  real& s12, real& m12, real& M12, real& M21)
429  const {
430  real t;
431  GenPosition(true, a12,
432  LATITUDE | LONGITUDE | AZIMUTH |
433  DISTANCE | REDUCEDLENGTH | GEODESICSCALE,
434  lat2, lon2, azi2, s12, m12, M12, M21, t);
435  }
437 
440 
500  Math::real GenPosition(bool arcmode, real s12_a12, unsigned outmask,
501  real& lat2, real& lon2, real& azi2,
502  real& s12, real& m12, real& M12, real& M21,
503  real& S12) const;
505 
508 
519  void SetDistance(real s13);
520 
530  void SetArc(real a13);
531 
543  void GenSetDistance(bool arcmode, real s13_a13);
544 
547 
552  bool Init() const { return _caps != 0U; }
553 
558  { return Init() ? _lat1 : Math::NaN(); }
559 
564  { return Init() ? _lon1 : Math::NaN(); }
565 
570  { return Init() ? _azi1 : Math::NaN(); }
571 
578  void Azimuth(real& sazi1, real& cazi1) const
579  { if (Init()) { sazi1 = _salp1; cazi1 = _calp1; } }
580 
588  { return Init() ? Math::atan2d(_salp0, _calp0) : Math::NaN(); }
589 
596  void EquatorialAzimuth(real& sazi0, real& cazi0) const
597  { if (Init()) { sazi0 = _salp0; cazi0 = _calp0; } }
598 
606  using std::atan2;
607  return Init() ? atan2(_ssig1, _csig1) / Math::degree() : Math::NaN();
608  }
609 
616  { return Init() ? _a : Math::NaN(); }
617 
623  { return Init() ? _f : Math::NaN(); }
624 
629  unsigned Capabilities() const { return _caps; }
630 
637  bool Capabilities(unsigned testcaps) const {
638  testcaps &= OUT_ALL;
639  return (_caps & testcaps) == testcaps;
640  }
641 
649  Math::real GenDistance(bool arcmode) const
650  { return Init() ? (arcmode ? _a13 : _s13) : Math::NaN(); }
651 
655  Math::real Distance() const { return GenDistance(false); }
656 
660  Math::real Arc() const { return GenDistance(true); }
662 
663  };
664 
665 } // namespace GeographicLib
666 
667 #endif // GEOGRAPHICLIB_GEODESICLINEEXACT_HPP
void ArcPosition(real a12, real &lat2, real &lon2, real &azi2) const
static T NaN()
Definition: Math.hpp:830
Math::real Position(real s12, real &lat2, real &lon2, real &azi2, real &m12) const
#define GEOGRAPHICLIB_EXPORT
Definition: Constants.hpp:91
Math::real Position(real s12, real &lat2, real &lon2, real &azi2, real &m12, real &M12, real &M21, real &S12) const
Math::real Position(real s12, real &lat2, real &lon2, real &azi2, real &M12, real &M21) const
Elliptic integrals and functions.
void g(const string &key, int i)
Definition: testBTree.cpp:43
void ArcPosition(real a12, real &lat2, real &lon2) const
Math::real Position(real s12, real &lat2, real &lon2, real &azi2, real &m12, real &M12, real &M21) const
Math::real Position(real s12, real &lat2, real &lon2) const
void ArcPosition(real a12, real &lat2, real &lon2, real &azi2, real &s12, real &m12) const
static T atan2d(T y, T x)
Definition: Math.hpp:691
void ArcPosition(real a12, real &lat2, real &lon2, real &azi2, real &s12, real &m12, real &M12, real &M21) const
Namespace for GeographicLib.
Math::real GenDistance(bool arcmode) const
Header for GeographicLib::EllipticFunction class.
Math::real Position(real s12, real &lat2, real &lon2, real &azi2) const
static T degree()
Definition: Math.hpp:216
Jet< T, N > atan2(const Jet< T, N > &g, const Jet< T, N > &f)
Definition: jet.h:556
void EquatorialAzimuth(real &sazi0, real &cazi0) const
Exact geodesic calculations.
void ArcPosition(real a12, real &lat2, real &lon2, real &azi2, real &s12, real &M12, real &M21) const
Header for GeographicLib::GeodesicExact class.
void Azimuth(real &sazi1, real &cazi1) const
Header for GeographicLib::Constants class.
bool Capabilities(unsigned testcaps) const
void ArcPosition(real a12, real &lat2, real &lon2, real &azi2, real &s12, real &m12, real &M12, real &M21, real &S12) const
void ArcPosition(real a12, real &lat2, real &lon2, real &azi2, real &s12) const
Point2 t(10, 10)


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:42:08