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 
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
GeographicLib::Geodesic::OUT_ALL
@ OUT_ALL
Definition: Geodesic.hpp:203
GeographicLib::GeodesicLine::ArcPosition
void ArcPosition(real a12, real &lat2, real &lon2, real &azi2, real &s12, real &M12, real &M21) const
Definition: GeodesicLine.hpp:452
GeographicLib::GeodesicLine::Flattening
Math::real Flattening() const
Definition: GeodesicLine.hpp:657
GeographicLib::Geodesic::CAP_MASK
@ CAP_MASK
Definition: Geodesic.hpp:202
GeographicLib::Math::NaN
static T NaN()
Definition: Math.hpp:830
GeographicLib::Geodesic::LATITUDE
@ LATITUDE
Definition: Geodesic.hpp:274
GeographicLib::GeodesicLine::ArcPosition
void ArcPosition(real a12, real &lat2, real &lon2, real &azi2, real &s12, real &m12, real &M12, real &M21) const
Definition: GeodesicLine.hpp:465
GeographicLib::GeodesicLine::ArcPosition
void ArcPosition(real a12, real &lat2, real &lon2, real &azi2) const
Definition: GeodesicLine.hpp:417
GeographicLib::Geodesic::ALL
@ ALL
Definition: Geodesic.hpp:323
GeographicLib
Namespace for GeographicLib.
Definition: JacobiConformal.hpp:15
GeographicLib::Geodesic::AZIMUTH
@ AZIMUTH
Definition: Geodesic.hpp:286
GeographicLib::GeodesicLine
A geodesic line.
Definition: GeodesicLine.hpp:71
GeographicLib::GeodesicLine::EquatorialAzimuth
void EquatorialAzimuth(real &sazi0, real &cazi0) const
Definition: GeodesicLine.hpp:633
GeographicLib::GeodesicLine::Position
Math::real Position(real s12, real &lat2, real &lon2) const
Definition: GeodesicLine.hpp:295
GeographicLib::GeodesicLine::Azimuth
void Azimuth(real &sazi1, real &cazi1) const
Definition: GeodesicLine.hpp:615
GeographicLib::Math::atan2d
static T atan2d(T y, T x)
Definition: Math.hpp:691
GeographicLib::GeodesicLine::tiny_
real tiny_
Definition: GeodesicLine.hpp:81
GeographicLib::GeodesicLine::GeodesicLine
GeodesicLine()
Definition: GeodesicLine.hpp:235
GeographicLib::GeodesicLine::Arc
Math::real Arc() const
Definition: GeodesicLine.hpp:695
GeographicLib::GeodesicLine::captype
captype
Definition: GeodesicLine.hpp:101
GEOGRAPHICLIB_EXPORT
#define GEOGRAPHICLIB_EXPORT
Definition: Constants.hpp:91
GeographicLib::GeodesicLine::Distance
Math::real Distance() const
Definition: GeodesicLine.hpp:690
GeographicLib::GeodesicLine::EquatorialArc
Math::real EquatorialArc() const
Definition: GeodesicLine.hpp:642
GeographicLib::Geodesic::LONG_UNROLL
@ LONG_UNROLL
Definition: Geodesic.hpp:317
GeographicLib::Geodesic::CAP_C4
@ CAP_C4
Definition: Geodesic.hpp:200
GeographicLib::GeodesicLine::MajorRadius
Math::real MajorRadius() const
Definition: GeodesicLine.hpp:650
GeographicLib::GeodesicLine::Position
Math::real Position(real s12, real &lat2, real &lon2, real &azi2, real &m12, real &M12, real &M21, real &S12) const
Definition: GeodesicLine.hpp:281
GeographicLib::Geodesic::GEODESICSCALE
@ GEODESICSCALE
Definition: Geodesic.hpp:307
GeographicLib::GeodesicLine::Position
Math::real Position(real s12, real &lat2, real &lon2, real &azi2, real &m12, real &M12, real &M21) const
Definition: GeodesicLine.hpp:341
GeographicLib::Geodesic::OUT_MASK
@ OUT_MASK
Definition: Geodesic.hpp:204
GeographicLib::GeodesicLine::real
Math::real real
Definition: GeodesicLine.hpp:73
GeographicLib::GeodesicLine::EquatorialAzimuth
Math::real EquatorialAzimuth() const
Definition: GeodesicLine.hpp:624
GeographicLib::GeodesicLine::ArcPosition
void ArcPosition(real a12, real &lat2, real &lon2, real &azi2, real &s12) const
Definition: GeodesicLine.hpp:429
GeographicLib::Geodesic::LONGITUDE
@ LONGITUDE
Definition: Geodesic.hpp:279
GeographicLib::Math::real
double real
Definition: Math.hpp:129
GeographicLib::GeodesicLine::Capabilities
bool Capabilities(unsigned testcaps) const
Definition: GeodesicLine.hpp:672
GeographicLib::GeodesicLine::GenDistance
Math::real GenDistance(bool arcmode) const
Definition: GeodesicLine.hpp:684
GeographicLib::GeodesicLine::_salp0
real _salp0
Definition: GeodesicLine.hpp:83
GeographicLib::GeodesicLine::Azimuth
Math::real Azimuth() const
Definition: GeodesicLine.hpp:606
GeographicLib::Geodesic::CAP_C1p
@ CAP_C1p
Definition: Geodesic.hpp:197
GeographicLib::GeodesicLine::_caps
unsigned _caps
Definition: GeodesicLine.hpp:90
GeographicLib::Geodesic::DISTANCE
@ DISTANCE
Definition: Geodesic.hpp:291
GeographicLib::GeodesicLine::_lon1
real _lon1
Definition: GeodesicLine.hpp:82
GeographicLib::Geodesic::NONE
@ NONE
Definition: Geodesic.hpp:268
GeographicLib::GeodesicLine::ArcPosition
void ArcPosition(real a12, real &lat2, real &lon2) const
Definition: GeodesicLine.hpp:406
GeographicLib::GeodesicLine::Capabilities
unsigned Capabilities() const
Definition: GeodesicLine.hpp:664
GeographicLib::Geodesic::CAP_C3
@ CAP_C3
Definition: Geodesic.hpp:199
GeographicLib::GeodesicLine::Position
Math::real Position(real s12, real &lat2, real &lon2, real &azi2, real &m12) const
Definition: GeodesicLine.hpp:316
Constants.hpp
Header for GeographicLib::Constants class.
g
void g(const string &key, int i)
Definition: testBTree.cpp:41
GeographicLib::GeodesicLine::Latitude
Math::real Latitude() const
Definition: GeodesicLine.hpp:594
GeographicLib::Geodesic::CAP_NONE
@ CAP_NONE
Definition: Geodesic.hpp:195
GeographicLib::Geodesic::CAP_C1
@ CAP_C1
Definition: Geodesic.hpp:196
GeographicLib::Geodesic::CAP_ALL
@ CAP_ALL
Definition: Geodesic.hpp:201
GeographicLib::Geodesic::nC1_
static const int nC1_
Definition: Geodesic.hpp:177
GeographicLib::Geodesic::nC4_
static const int nC4_
Definition: Geodesic.hpp:185
GeographicLib::Geodesic::nC1p_
static const int nC1p_
Definition: Geodesic.hpp:178
GeographicLib::Geodesic::nC3_
static const int nC3_
Definition: Geodesic.hpp:183
GeographicLib::GeodesicLine::_B41
real _B41
Definition: GeodesicLine.hpp:85
GeographicLib::Geodesic::AREA
@ AREA
Definition: Geodesic.hpp:312
GeographicLib::Geodesic::REDUCEDLENGTH
@ REDUCEDLENGTH
Definition: Geodesic.hpp:302
GeographicLib::Geodesic::nC2_
static const int nC2_
Definition: Geodesic.hpp:180
U
@ U
Definition: testDecisionTree.cpp:349
GeographicLib::GeodesicLine::mask
mask
Definition: GeodesicLine.hpp:121
GeographicLib::GeodesicLine::Init
bool Init() const
Definition: GeodesicLine.hpp:589
GeographicLib::GeodesicLine::Position
Math::real Position(real s12, real &lat2, real &lon2, real &azi2) const
Definition: GeodesicLine.hpp:305
align_3::t
Point2 t(10, 10)
GeographicLib::Geodesic::CAP_C2
@ CAP_C2
Definition: Geodesic.hpp:198
real
Definition: main.h:100
GeographicLib::GeodesicLine::_stau1
real _stau1
Definition: GeodesicLine.hpp:84
GeographicLib::Geodesic
Geodesic calculations
Definition: Geodesic.hpp:172
Geodesic.hpp
Header for GeographicLib::Geodesic class.
GeographicLib::GeodesicLine::ArcPosition
void ArcPosition(real a12, real &lat2, real &lon2, real &azi2, real &s12, real &m12, real &M12, real &M21, real &S12) const
Definition: GeodesicLine.hpp:394
GeographicLib::GeodesicLine::Longitude
Math::real Longitude() const
Definition: GeodesicLine.hpp:600
GeographicLib::GeodesicLine::Position
Math::real Position(real s12, real &lat2, real &lon2, real &azi2, real &M12, real &M21) const
Definition: GeodesicLine.hpp:328
GeographicLib::GeodesicLine::ArcPosition
void ArcPosition(real a12, real &lat2, real &lon2, real &azi2, real &s12, real &m12) const
Definition: GeodesicLine.hpp:440
GeographicLib::GeodesicLine::_s13
real _s13
Definition: GeodesicLine.hpp:86
GeographicLib::Geodesic::DISTANCE_IN
@ DISTANCE_IN
Definition: Geodesic.hpp:297


gtsam
Author(s):
autogenerated on Fri Nov 1 2024 03:32:38