examples/example-NormalGravity.cpp
Go to the documentation of this file.
1 // Example of using the GeographicLib::NormalGravity class
2 
3 #include <iostream>
4 #include <exception>
7 
8 using namespace std;
9 using namespace GeographicLib;
10 
11 int main() {
12  try {
13  NormalGravity grav(Constants::WGS84_a(), Constants::WGS84_GM(),
14  Constants::WGS84_omega(), Constants::WGS84_f());
15  // Alternatively: const NormalGravity& grav = NormalGravity::WGS84();
16  double lat = 27.99, h = 8820; // Mt Everest
17  double gammay, gammaz;
18  grav.Gravity(lat, h, gammay, gammaz);
19  cout << gammay << " " << gammaz << "\n";
20  }
21  catch (const exception& e) {
22  cerr << "Caught exception: " << e.what() << "\n";
23  return 1;
24  }
25 }
static const double lat
Math::real Gravity(real lat, real h, real &gammay, real &gammaz) const
The normal gravity of the earth.
Definition: Half.h:150
Namespace for GeographicLib.
Array< double, 1, 3 > e(1./3., 0.5, 2.)
const double h
Header for GeographicLib::NormalGravity class.
Header for GeographicLib::Constants class.


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