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 
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
GeographicLib::GeodesicExact::DISTANCE_IN
@ DISTANCE_IN
Definition: GeodesicExact.hpp:192
GeographicLib::Math::NaN
static T NaN()
Definition: Math.hpp:830
GeographicLib::GeodesicExact
Exact geodesic calculations.
Definition: GeodesicExact.hpp:80
GeographicLib::GeodesicExact::CAP_MASK
@ CAP_MASK
Definition: GeodesicExact.hpp:98
GeographicLib
Namespace for GeographicLib.
Definition: JacobiConformal.hpp:15
GeographicLib::GeodesicLineExact::ArcPosition
void ArcPosition(real a12, real &lat2, real &lon2, real &azi2) const
Definition: GeodesicLineExact.hpp:379
EllipticFunction.hpp
Header for GeographicLib::EllipticFunction class.
GeographicLib::GeodesicExact::NONE
@ NONE
Definition: GeodesicExact.hpp:163
GeographicLib::GeodesicLineExact::EquatorialAzimuth
void EquatorialAzimuth(real &sazi0, real &cazi0) const
Definition: GeodesicLineExact.hpp:596
GeographicLib::GeodesicExact::OUT_MASK
@ OUT_MASK
Definition: GeodesicExact.hpp:100
GeographicLib::Math::atan2d
static T atan2d(T y, T x)
Definition: Math.hpp:691
GeographicLib::GeodesicLineExact::real
Math::real real
Definition: GeodesicLineExact.hpp:37
GeographicLib::GeodesicExact::CAP_D
@ CAP_D
Definition: GeodesicExact.hpp:94
GeographicLib::EllipticFunction
Elliptic integrals and functions.
Definition: EllipticFunction.hpp:62
GeographicLib::GeodesicLineExact::Latitude
Math::real Latitude() const
Definition: GeodesicLineExact.hpp:557
GeographicLib::GeodesicLineExact::tiny_
real tiny_
Definition: GeodesicLineExact.hpp:41
GEOGRAPHICLIB_EXPORT
#define GEOGRAPHICLIB_EXPORT
Definition: Constants.hpp:91
GeographicLib::GeodesicLineExact::Position
Math::real Position(real s12, real &lat2, real &lon2, real &azi2) const
Definition: GeodesicLineExact.hpp:267
GeographicLib::GeodesicLineExact::ArcPosition
void ArcPosition(real a12, real &lat2, real &lon2, real &azi2, real &s12, real &m12, real &M12, real &M21) const
Definition: GeodesicLineExact.hpp:427
GeographicLib::GeodesicLineExact::_caps
unsigned _caps
Definition: GeodesicLineExact.hpp:50
GeographicLib::GeodesicLineExact::Longitude
Math::real Longitude() const
Definition: GeodesicLineExact.hpp:563
GeographicLib::GeodesicExact::ALL
@ ALL
Definition: GeodesicExact.hpp:218
GeographicLib::GeodesicLineExact::Capabilities
unsigned Capabilities() const
Definition: GeodesicLineExact.hpp:629
GeographicLib::GeodesicExact::CAP_H
@ CAP_H
Definition: GeodesicExact.hpp:95
GeographicLib::GeodesicLineExact::Init
bool Init() const
Definition: GeodesicLineExact.hpp:552
GeographicLib::Math::real
double real
Definition: Math.hpp:129
GeodesicExact.hpp
Header for GeographicLib::GeodesicExact class.
GeographicLib::Math::degree
static T degree()
Definition: Math.hpp:216
GeographicLib::GeodesicExact::OUT_ALL
@ OUT_ALL
Definition: GeodesicExact.hpp:99
GeographicLib::GeodesicLineExact::ArcPosition
void ArcPosition(real a12, real &lat2, real &lon2) const
Definition: GeodesicLineExact.hpp:368
GeographicLib::GeodesicLineExact::EquatorialAzimuth
Math::real EquatorialAzimuth() const
Definition: GeodesicLineExact.hpp:587
GeographicLib::GeodesicLineExact::Azimuth
void Azimuth(real &sazi1, real &cazi1) const
Definition: GeodesicLineExact.hpp:578
GeographicLib::GeodesicExact::LATITUDE
@ LATITUDE
Definition: GeodesicExact.hpp:169
GeographicLib::GeodesicLineExact::ArcPosition
void ArcPosition(real a12, real &lat2, real &lon2, real &azi2, real &s12) const
Definition: GeodesicLineExact.hpp:391
GeographicLib::GeodesicLineExact::GenDistance
Math::real GenDistance(bool arcmode) const
Definition: GeodesicLineExact.hpp:649
GeographicLib::GeodesicLineExact::_salp0
real _salp0
Definition: GeodesicLineExact.hpp:43
GeographicLib::GeodesicLineExact::Azimuth
Math::real Azimuth() const
Definition: GeodesicLineExact.hpp:569
GeographicLib::GeodesicExact::CAP_ALL
@ CAP_ALL
Definition: GeodesicExact.hpp:97
GeographicLib::GeodesicLineExact::Flattening
Math::real Flattening() const
Definition: GeodesicLineExact.hpp:622
GeographicLib::GeodesicLineExact::ArcPosition
void ArcPosition(real a12, real &lat2, real &lon2, real &azi2, real &s12, real &m12, real &M12, real &M21, real &S12) const
Definition: GeodesicLineExact.hpp:356
GeographicLib::GeodesicExact::GEODESICSCALE
@ GEODESICSCALE
Definition: GeodesicExact.hpp:202
GeographicLib::GeodesicLineExact::Distance
Math::real Distance() const
Definition: GeodesicLineExact.hpp:655
GeographicLib::GeodesicExact::REDUCEDLENGTH
@ REDUCEDLENGTH
Definition: GeodesicExact.hpp:197
Constants.hpp
Header for GeographicLib::Constants class.
g
void g(const string &key, int i)
Definition: testBTree.cpp:41
GeographicLib::GeodesicLineExact::_H1
real _H1
Definition: GeodesicLineExact.hpp:46
GeographicLib::GeodesicLineExact::Position
Math::real Position(real s12, real &lat2, real &lon2, real &azi2, real &m12) const
Definition: GeodesicLineExact.hpp:278
atan2
AnnoyingScalar atan2(const AnnoyingScalar &y, const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:110
GeographicLib::GeodesicExact::LONGITUDE
@ LONGITUDE
Definition: GeodesicExact.hpp:174
GeographicLib::GeodesicLineExact::EquatorialArc
Math::real EquatorialArc() const
Definition: GeodesicLineExact.hpp:605
GeographicLib::GeodesicLineExact::Position
Math::real Position(real s12, real &lat2, real &lon2, real &azi2, real &M12, real &M21) const
Definition: GeodesicLineExact.hpp:290
GeographicLib::GeodesicLineExact::_stau1
real _stau1
Definition: GeodesicLineExact.hpp:44
GeographicLib::GeodesicExact::CAP_C4
@ CAP_C4
Definition: GeodesicExact.hpp:96
GeographicLib::GeodesicLineExact::Position
Math::real Position(real s12, real &lat2, real &lon2, real &azi2, real &m12, real &M12, real &M21) const
Definition: GeodesicLineExact.hpp:303
GeographicLib::GeodesicLineExact::_lon1
real _lon1
Definition: GeodesicLineExact.hpp:42
GeographicLib::GeodesicLineExact
An exact geodesic line.
Definition: GeodesicLineExact.hpp:35
GeographicLib::GeodesicExact::AZIMUTH
@ AZIMUTH
Definition: GeodesicExact.hpp:181
GeographicLib::GeodesicExact::DISTANCE
@ DISTANCE
Definition: GeodesicExact.hpp:186
GeographicLib::GeodesicLineExact::Position
Math::real Position(real s12, real &lat2, real &lon2, real &azi2, real &m12, real &M12, real &M21, real &S12) const
Definition: GeodesicLineExact.hpp:243
GeographicLib::GeodesicLineExact::ArcPosition
void ArcPosition(real a12, real &lat2, real &lon2, real &azi2, real &s12, real &m12) const
Definition: GeodesicLineExact.hpp:402
GeographicLib::GeodesicLineExact::captype
captype
Definition: GeodesicLineExact.hpp:61
GeographicLib::GeodesicExact::CAP_E
@ CAP_E
Definition: GeodesicExact.hpp:92
GeographicLib::GeodesicExact::CAP_NONE
@ CAP_NONE
Definition: GeodesicExact.hpp:91
U
@ U
Definition: testDecisionTree.cpp:349
GeographicLib::GeodesicLineExact::MajorRadius
Math::real MajorRadius() const
Definition: GeodesicLineExact.hpp:615
GeographicLib::GeodesicLineExact::_somg1
real _somg1
Definition: GeodesicLineExact.hpp:45
GeographicLib::GeodesicExact::nC4_
static const int nC4_
Definition: GeodesicExact.hpp:84
GeographicLib::GeodesicLineExact::_s13
real _s13
Definition: GeodesicLineExact.hpp:47
GeographicLib::GeodesicLineExact::GeodesicLineExact
GeodesicLineExact()
Definition: GeodesicLineExact.hpp:197
align_3::t
Point2 t(10, 10)
GeographicLib::GeodesicLineExact::ArcPosition
void ArcPosition(real a12, real &lat2, real &lon2, real &azi2, real &s12, real &M12, real &M21) const
Definition: GeodesicLineExact.hpp:414
GeographicLib::GeodesicLineExact::_E
EllipticFunction _E
Definition: GeodesicLineExact.hpp:49
real
Definition: main.h:100
GeographicLib::GeodesicLineExact::Arc
Math::real Arc() const
Definition: GeodesicLineExact.hpp:660
GeographicLib::GeodesicLineExact::Capabilities
bool Capabilities(unsigned testcaps) const
Definition: GeodesicLineExact.hpp:637
GeographicLib::GeodesicLineExact::mask
mask
Definition: GeodesicLineExact.hpp:81
GeographicLib::GeodesicLineExact::Position
Math::real Position(real s12, real &lat2, real &lon2) const
Definition: GeodesicLineExact.hpp:257
GeographicLib::GeodesicExact::LONG_UNROLL
@ LONG_UNROLL
Definition: GeodesicExact.hpp:212
GeographicLib::GeodesicExact::AREA
@ AREA
Definition: GeodesicExact.hpp:207


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:02:22