GravityCircle.hpp
Go to the documentation of this file.
1 
10 #if !defined(GEOGRAPHICLIB_GRAVITYCIRCLE_HPP)
11 #define GEOGRAPHICLIB_GRAVITYCIRCLE_HPP 1
12 
13 #include <vector>
17 
18 namespace GeographicLib {
19 
42  private:
43  typedef Math::real real;
44  enum mask {
48  DISTURBING_POTENTIAL = GravityModel::DISTURBING_POTENTIAL,
50  SPHERICAL_ANOMALY = GravityModel::SPHERICAL_ANOMALY,
52  };
53 
54  unsigned _caps;
55  real _a, _f, _lat, _h, _Z, _Px, _invR, _cpsi, _spsi,
56  _cphi, _sphi, _amodel, _GMmodel, _dzonal0,
57  _corrmult, _gamma0, _gamma, _frot;
58  CircularEngine _gravitational, _disturbing, _correction;
59 
60  GravityCircle(mask caps, real a, real f, real lat, real h,
61  real Z, real P, real cphi, real sphi,
62  real amodel, real GMmodel, real dzonal0, real corrmult,
63  real gamma0, real gamma, real frot,
64  const CircularEngine& gravitational,
65  const CircularEngine& disturbing,
66  const CircularEngine& correction)
67  : _caps(caps)
68  , _a(a)
69  , _f(f)
70  , _lat(Math::LatFix(lat))
71  , _h(h)
72  , _Z(Z)
73  , _Px(P)
74  , _invR(1 / Math::hypot(_Px, _Z))
75  , _cpsi(_Px * _invR)
76  , _spsi(_Z * _invR)
77  , _cphi(cphi)
78  , _sphi(sphi)
79  , _amodel(amodel)
80  , _GMmodel(GMmodel)
81  , _dzonal0(dzonal0)
82  , _corrmult(corrmult)
83  , _gamma0(gamma0)
84  , _gamma(gamma)
85  , _frot(frot)
86  , _gravitational(gravitational)
87  , _disturbing(disturbing)
88  , _correction(correction)
89  {}
90 
91  friend class GravityModel; // GravityModel calls the private constructor
92  Math::real W(real slam, real clam,
93  real& gX, real& gY, real& gZ) const;
94  Math::real V(real slam, real clam,
95  real& gX, real& gY, real& gZ) const;
96  Math::real InternalT(real slam, real clam,
97  real& deltaX, real& deltaY, real& deltaZ,
98  bool gradp, bool correct) const;
99  public:
105  GravityCircle() : _a(-1) {}
106 
109 
125  Math::real Gravity(real lon, real& gx, real& gy, real& gz) const;
126 
140  Math::real Disturbance(real lon, real& deltax, real& deltay, real& deltaz)
141  const;
142 
154  Math::real GeoidHeight(real lon) const;
155 
171  void SphericalAnomaly(real lon, real& Dg01, real& xi, real& eta)
172  const;
173 
188  Math::real W(real lon, real& gX, real& gY, real& gZ) const {
189  real slam, clam;
190  Math::sincosd(lon, slam, clam);
191  return W(slam, clam, gX, gY, gZ);
192  }
193 
208  Math::real V(real lon, real& GX, real& GY, real& GZ) const {
209  real slam, clam;
210  Math::sincosd(lon, slam, clam);
211  return V(slam, clam, GX, GY, GZ);
212  }
213 
228  Math::real T(real lon, real& deltaX, real& deltaY, real& deltaZ)
229  const {
230  real slam, clam;
231  Math::sincosd(lon, slam, clam);
232  return InternalT(slam, clam, deltaX, deltaY, deltaZ, true, true);
233  }
234 
242  Math::real T(real lon) const {
243  real slam, clam, dummy;
244  Math::sincosd(lon, slam, clam);
245  return InternalT(slam, clam, dummy, dummy, dummy, false, true);
246  }
247 
249 
252 
256  bool Init() const { return _a > 0; }
257 
264  { return Init() ? _a : Math::NaN(); }
265 
271  { return Init() ? _f : Math::NaN(); }
272 
277  { return Init() ? _lat : Math::NaN(); }
278 
283  { return Init() ? _h : Math::NaN(); }
284 
289  unsigned Capabilities() const { return _caps; }
290 
295  bool Capabilities(unsigned testcaps) const {
296  return (_caps & testcaps) == testcaps;
297  }
299  };
300 
301 } // namespace GeographicLib
302 
303 #endif // GEOGRAPHICLIB_GRAVITYCIRCLE_HPP
static T NaN()
Definition: Math.hpp:830
#define GEOGRAPHICLIB_EXPORT
Definition: Constants.hpp:91
static const double lat
bool Capabilities(unsigned testcaps) const
Mathematical functions needed by GeographicLib.
Definition: Math.hpp:102
static void sincosd(T x, T &sinx, T &cosx)
Definition: Math.hpp:558
Key W(std::uint64_t j)
Header for GeographicLib::GravityModel class.
Math::real Flattening() const
#define Z
Definition: icosphere.cpp:21
Math::real T(real lon, real &deltaX, real &deltaY, real &deltaZ) const
Math::real MajorRadius() const
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Namespace for GeographicLib.
Header for GeographicLib::CircularEngine class.
Vector xi
Definition: testPose2.cpp:148
Spherical harmonic sums for a circle.
Model of the earth&#39;s gravity field.
const double h
Header for GeographicLib::Constants class.
Math::real W(real lon, real &gX, real &gY, real &gZ) const
Math::real T(real lon) const
static const double lon
Math::real V(real lon, real &GX, real &GY, real &GZ) const
GravityCircle(mask caps, real a, real f, real lat, real h, real Z, real P, real cphi, real sphi, real amodel, real GMmodel, real dzonal0, real corrmult, real gamma0, real gamma, real frot, const CircularEngine &gravitational, const CircularEngine &disturbing, const CircularEngine &correction)
Gravity on a circle of latitude.


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