GeodesicLine.hpp
Go to the documentation of this file.
1 
10 #if !defined(GEOGRAPHICLIB_GEODESICLINE_HPP)
11 #define GEOGRAPHICLIB_GEODESICLINE_HPP 1
12 
15 
16 namespace GeographicLib {
17 
72  private:
73  typedef Math::real real;
74  friend class Geodesic;
75  static const int nC1_ = Geodesic::nC1_;
76  static const int nC1p_ = Geodesic::nC1p_;
77  static const int nC2_ = Geodesic::nC2_;
78  static const int nC3_ = Geodesic::nC3_;
79  static const int nC4_ = Geodesic::nC4_;
80 
81  real tiny_;
82  real _lat1, _lon1, _azi1;
83  real _a, _f, _b, _c2, _f1, _salp0, _calp0, _k2,
84  _salp1, _calp1, _ssig1, _csig1, _dn1, _stau1, _ctau1, _somg1, _comg1,
85  _A1m1, _A2m1, _A3c, _B11, _B21, _B31, _A4, _B41;
86  real _a13, _s13;
87  // index zero elements of _C1a, _C1pa, _C2a, _C3a are unused
88  real _C1a[nC1_ + 1], _C1pa[nC1p_ + 1], _C2a[nC2_ + 1], _C3a[nC3_],
89  _C4a[nC4_]; // all the elements of _C4a are used
90  unsigned _caps;
91 
92  void LineInit(const Geodesic& g,
93  real lat1, real lon1,
94  real azi1, real salp1, real calp1,
95  unsigned caps);
96  GeodesicLine(const Geodesic& g,
97  real lat1, real lon1,
98  real azi1, real salp1, real calp1,
99  unsigned caps, bool arcmode, real s13_a13);
100 
101  enum captype {
102  CAP_NONE = Geodesic::CAP_NONE,
104  CAP_C1p = Geodesic::CAP_C1p,
108  CAP_ALL = Geodesic::CAP_ALL,
109  CAP_MASK = Geodesic::CAP_MASK,
110  OUT_ALL = Geodesic::OUT_ALL,
111  OUT_MASK = Geodesic::OUT_MASK,
112  };
113  public:
114 
121  enum mask {
132  LATITUDE = Geodesic::LATITUDE,
137  LONGITUDE = Geodesic::LONGITUDE,
144  AZIMUTH = Geodesic::AZIMUTH,
149  DISTANCE = Geodesic::DISTANCE,
155  DISTANCE_IN = Geodesic::DISTANCE_IN,
160  REDUCEDLENGTH = Geodesic::REDUCEDLENGTH,
165  GEODESICSCALE = Geodesic::GEODESICSCALE,
175  LONG_UNROLL = Geodesic::LONG_UNROLL,
182  };
183 
186 
226  GeodesicLine(const Geodesic& g, real lat1, real lon1, real azi1,
227  unsigned caps = ALL);
228 
235  GeodesicLine() : _caps(0U) {}
237 
240 
282  real& lat2, real& lon2, real& azi2,
283  real& m12, real& M12, real& M21,
284  real& S12) const {
285  real t;
286  return GenPosition(false, s12,
287  LATITUDE | LONGITUDE | AZIMUTH |
288  REDUCEDLENGTH | GEODESICSCALE | AREA,
289  lat2, lon2, azi2, t, m12, M12, M21, S12);
290  }
291 
295  Math::real Position(real s12, real& lat2, real& lon2) const {
296  real t;
297  return GenPosition(false, s12,
298  LATITUDE | LONGITUDE,
299  lat2, lon2, t, t, t, t, t, t);
300  }
301 
305  Math::real Position(real s12, real& lat2, real& lon2,
306  real& azi2) const {
307  real t;
308  return GenPosition(false, s12,
309  LATITUDE | LONGITUDE | AZIMUTH,
310  lat2, lon2, azi2, t, t, t, t, t);
311  }
312 
316  Math::real Position(real s12, real& lat2, real& lon2,
317  real& azi2, real& m12) const {
318  real t;
319  return GenPosition(false, s12,
320  LATITUDE | LONGITUDE |
321  AZIMUTH | REDUCEDLENGTH,
322  lat2, lon2, azi2, t, m12, t, t, t);
323  }
324 
328  Math::real Position(real s12, real& lat2, real& lon2,
329  real& azi2, real& M12, real& M21)
330  const {
331  real t;
332  return GenPosition(false, s12,
333  LATITUDE | LONGITUDE |
334  AZIMUTH | GEODESICSCALE,
335  lat2, lon2, azi2, t, t, M12, M21, t);
336  }
337 
342  real& lat2, real& lon2, real& azi2,
343  real& m12, real& M12, real& M21)
344  const {
345  real t;
346  return GenPosition(false, s12,
347  LATITUDE | LONGITUDE | AZIMUTH |
348  REDUCEDLENGTH | GEODESICSCALE,
349  lat2, lon2, azi2, t, m12, M12, M21, t);
350  }
352 
355 
394  void ArcPosition(real a12, real& lat2, real& lon2, real& azi2,
395  real& s12, real& m12, real& M12, real& M21,
396  real& S12) const {
397  GenPosition(true, a12,
398  LATITUDE | LONGITUDE | AZIMUTH | DISTANCE |
399  REDUCEDLENGTH | GEODESICSCALE | AREA,
400  lat2, lon2, azi2, s12, m12, M12, M21, S12);
401  }
402 
406  void ArcPosition(real a12, real& lat2, real& lon2)
407  const {
408  real t;
409  GenPosition(true, a12,
410  LATITUDE | LONGITUDE,
411  lat2, lon2, t, t, t, t, t, t);
412  }
413 
417  void ArcPosition(real a12,
418  real& lat2, real& lon2, real& azi2)
419  const {
420  real t;
421  GenPosition(true, a12,
422  LATITUDE | LONGITUDE | AZIMUTH,
423  lat2, lon2, azi2, t, t, t, t, t);
424  }
425 
429  void ArcPosition(real a12, real& lat2, real& lon2, real& azi2,
430  real& s12) const {
431  real t;
432  GenPosition(true, a12,
433  LATITUDE | LONGITUDE | AZIMUTH | DISTANCE,
434  lat2, lon2, azi2, s12, t, t, t, t);
435  }
436 
440  void ArcPosition(real a12, real& lat2, real& lon2, real& azi2,
441  real& s12, real& m12) const {
442  real t;
443  GenPosition(true, a12,
444  LATITUDE | LONGITUDE | AZIMUTH |
445  DISTANCE | REDUCEDLENGTH,
446  lat2, lon2, azi2, s12, m12, t, t, t);
447  }
448 
452  void ArcPosition(real a12, real& lat2, real& lon2, real& azi2,
453  real& s12, real& M12, real& M21)
454  const {
455  real t;
456  GenPosition(true, a12,
457  LATITUDE | LONGITUDE | AZIMUTH |
458  DISTANCE | GEODESICSCALE,
459  lat2, lon2, azi2, s12, t, M12, M21, t);
460  }
461 
465  void ArcPosition(real a12, real& lat2, real& lon2, real& azi2,
466  real& s12, real& m12, real& M12, real& M21)
467  const {
468  real t;
469  GenPosition(true, a12,
470  LATITUDE | LONGITUDE | AZIMUTH |
471  DISTANCE | REDUCEDLENGTH | GEODESICSCALE,
472  lat2, lon2, azi2, s12, m12, M12, M21, t);
473  }
475 
478 
537  Math::real GenPosition(bool arcmode, real s12_a12, unsigned outmask,
538  real& lat2, real& lon2, real& azi2,
539  real& s12, real& m12, real& M12, real& M21,
540  real& S12) const;
542 
545 
556  void SetDistance(real s13);
557 
567  void SetArc(real a13);
568 
579  void GenSetDistance(bool arcmode, real s13_a13);
581 
584 
589  bool Init() const { return _caps != 0U; }
590 
595  { return Init() ? _lat1 : Math::NaN(); }
596 
601  { return Init() ? _lon1 : Math::NaN(); }
602 
607  { return Init() ? _azi1 : Math::NaN(); }
608 
615  void Azimuth(real& sazi1, real& cazi1) const
616  { if (Init()) { sazi1 = _salp1; cazi1 = _calp1; } }
617 
625  { return Init() ? Math::atan2d(_salp0, _calp0) : Math::NaN(); }
626 
633  void EquatorialAzimuth(real& sazi0, real& cazi0) const
634  { if (Init()) { sazi0 = _salp0; cazi0 = _calp0; } }
635 
643  return Init() ? Math::atan2d(_ssig1, _csig1) : Math::NaN();
644  }
645 
651  { return Init() ? _a : Math::NaN(); }
652 
658  { return Init() ? _f : Math::NaN(); }
659 
664  unsigned Capabilities() const { return _caps; }
665 
672  bool Capabilities(unsigned testcaps) const {
673  testcaps &= OUT_ALL;
674  return (_caps & testcaps) == testcaps;
675  }
676 
684  Math::real GenDistance(bool arcmode) const
685  { return Init() ? (arcmode ? _a13 : _s13) : Math::NaN(); }
686 
690  Math::real Distance() const { return GenDistance(false); }
691 
695  Math::real Arc() const { return GenDistance(true); }
697 
698  };
699 
700 } // namespace GeographicLib
701 
702 #endif // GEOGRAPHICLIB_GEODESICLINE_HPP
Math::real Position(real s12, real &lat2, real &lon2) const
static T NaN()
Definition: Math.hpp:830
void ArcPosition(real a12, real &lat2, real &lon2, real &azi2) const
#define GEOGRAPHICLIB_EXPORT
Definition: Constants.hpp:91
void EquatorialAzimuth(real &sazi0, real &cazi0) const
Math::real Flattening() const
void ArcPosition(real a12, real &lat2, real &lon2, real &azi2, real &s12, real &m12, real &M12, real &M21) const
static const int nC4_
Definition: Geodesic.hpp:185
void Azimuth(real &sazi1, real &cazi1) const
Math::real Position(real s12, real &lat2, real &lon2, real &azi2, real &m12, real &M12, real &M21, real &S12) const
Math::real GenDistance(bool arcmode) const
void ArcPosition(real a12, real &lat2, real &lon2, real &azi2, real &s12) const
Math::real MajorRadius() const
Math::real EquatorialArc() const
void g(const string &key, int i)
Definition: testBTree.cpp:41
Math::real Position(real s12, real &lat2, real &lon2, real &azi2, real &m12, real &M12, real &M21) const
unsigned Capabilities() const
Math::real Azimuth() const
Math::real Distance() const
static const int nC2_
Definition: Geodesic.hpp:180
Header for GeographicLib::Geodesic class.
Math::real EquatorialAzimuth() const
void ArcPosition(real a12, real &lat2, real &lon2) const
bool Capabilities(unsigned testcaps) const
static T atan2d(T y, T x)
Definition: Math.hpp:691
static const int nC3_
Definition: Geodesic.hpp:183
Namespace for GeographicLib.
static const int nC1_
Definition: Geodesic.hpp:177
Math::real Position(real s12, real &lat2, real &lon2, real &azi2, real &m12) const
Math::real Latitude() const
Header for GeographicLib::Constants class.
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, real &M12, real &M21) const
void ArcPosition(real a12, real &lat2, real &lon2, real &azi2, real &s12, real &m12) const
Math::real Position(real s12, real &lat2, real &lon2, real &azi2) const
Math::real Position(real s12, real &lat2, real &lon2, real &azi2, real &M12, real &M21) const
Geodesic calculations
Definition: Geodesic.hpp:172
Point2 t(10, 10)
static const int nC1p_
Definition: Geodesic.hpp:178
Math::real Longitude() const


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:34:18