NormalGravity.hpp
Go to the documentation of this file.
1 
10 #if !defined(GEOGRAPHICLIB_NORMALGRAVITY_HPP)
11 #define GEOGRAPHICLIB_NORMALGRAVITY_HPP 1
12 
15 
16 namespace GeographicLib {
17 
80  private:
81  static const int maxit_ = 20;
82  typedef Math::real real;
83  friend class GravityModel;
84  real _a, _GM, _omega, _f, _J2, _omega2, _aomega2;
85  real _e2, _ep2, _b, _E, _U0, _gammae, _gammap, _Q0, _k, _fstar;
87  static real atanzz(real x, bool alt) {
88  // This routine obeys the identity
89  // atanzz(x, alt) = atanzz(-x/(1+x), !alt)
90  //
91  // Require x >= -1. Best to call with alt, s.t. x >= 0; this results in
92  // a call to atan, instead of asin, or to asinh, instead of atanh.
93  using std::sqrt; using std::abs; using std::atan; using std::asin;
94  real z = sqrt(abs(x));
95  return x == 0 ? 1 :
96  (alt ?
97  (!(x < 0) ? Math::asinh(z) : asin(z)) / sqrt(abs(x) / (1 + x)) :
98  (!(x < 0) ? atan(z) : Math::atanh(z)) / z);
99  }
100  static real atan7series(real x);
101  static real atan5series(real x);
102  static real Qf(real x, bool alt);
103  static real Hf(real x, bool alt);
104  static real QH3f(real x, bool alt);
105  real Jn(int n) const;
106  void Initialize(real a, real GM, real omega, real f_J2, bool geometricp);
107  public:
108 
111 
142  NormalGravity(real a, real GM, real omega, real f_J2,
143  bool geometricp = true);
172  GEOGRAPHICLIB_DEPRECATED("Use new NormalGravity constructor")
173  NormalGravity(real a, real GM, real omega, real f, real J2);
174 
180  NormalGravity() : _a(-1) {}
182 
185 
198  Math::real SurfaceGravity(real lat) const;
199 
219  Math::real Gravity(real lat, real h, real& gammay, real& gammaz)
220  const;
221 
242  Math::real U(real X, real Y, real Z,
243  real& gammaX, real& gammaY, real& gammaZ) const;
244 
265  Math::real V0(real X, real Y, real Z,
266  real& GammaX, real& GammaY, real& GammaZ) const;
267 
284  Math::real Phi(real X, real Y, real& fX, real& fY) const;
286 
289 
293  bool Init() const { return _a > 0; }
294 
300  { return Init() ? _a : Math::NaN(); }
301 
308  { return Init() ? _GM : Math::NaN(); }
309 
323  { return Init() ? ( n == 2 ? _J2 : Jn(n)) : Math::NaN(); }
324 
330  { return Init() ? _omega : Math::NaN(); }
331 
337  { return Init() ? _f : Math::NaN(); }
338 
344  { return Init() ? _gammae : Math::NaN(); }
345 
351  { return Init() ? _gammap : Math::NaN(); }
352 
358  { return Init() ? _fstar : Math::NaN(); }
359 
365  { return Init() ? _U0 : Math::NaN(); }
366 
370  const Geocentric& Earth() const { return _earth; }
372 
376  static const NormalGravity& WGS84();
377 
381  static const NormalGravity& GRS80();
382 
401  static Math::real J2ToFlattening(real a, real GM, real omega, real J2);
402 
418  static Math::real FlatteningToJ2(real a, real GM, real omega, real f);
419  };
420 
421 } // namespace GeographicLib
422 
423 #endif // GEOGRAPHICLIB_NORMALGRAVITY_HPP
static T NaN()
Definition: Math.hpp:830
#define GEOGRAPHICLIB_EXPORT
Definition: Constants.hpp:91
Math::real PolarGravity() const
const Vector3 V0(0, 0, 0)
static const double lat
The normal gravity of the earth.
int n
EIGEN_DEVICE_FUNC const SqrtReturnType sqrt() const
static T atanh(T x)
Definition: Math.hpp:328
Math::real MajorRadius() const
Math::real Flattening() const
Math::real EquatorialGravity() const
const Geocentric & Earth() const
Math::real AngularVelocity() const
Array33i a
static T asinh(T x)
Definition: Math.hpp:311
Geocentric coordinates
Definition: Geocentric.hpp:67
#define Z
Definition: icosphere.cpp:21
Math::real SurfacePotential() const
EIGEN_DEVICE_FUNC const AtanReturnType atan() const
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Namespace for GeographicLib.
Math::real DynamicalFormFactor(int n=2) const
Header for GeographicLib::Geocentric class.
Model of the earth&#39;s gravity field.
const double h
Header for GeographicLib::Constants class.
#define GEOGRAPHICLIB_DEPRECATED(msg)
Definition: Constants.hpp:106
static real atanzz(real x, bool alt)
#define X
Definition: icosphere.cpp:20
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
#define abs(x)
Definition: datatypes.h:17
EIGEN_DEVICE_FUNC const AsinReturnType asin() const
Math::real GravityFlattening() const
Math::real MassConstant() const


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:43:04