examples/example-GravityModel.cpp
Go to the documentation of this file.
1 // Example of using the GeographicLib::GravityModel class
2 
3 #include <iostream>
4 #include <exception>
6 
7 using namespace std;
8 using namespace GeographicLib;
9 
10 int main() {
11  try {
12  GravityModel grav("egm96");
13  double lat = 27.99, lon = 86.93, h = 8820; // Mt Everest
14  double gx, gy, gz;
15  grav.Gravity(lat,lon, h, gx, gy, gz);
16  cout << gx << " " << gy << " " << gz << "\n";
17  }
18  catch (const exception& e) {
19  cerr << "Caught exception: " << e.what() << "\n";
20  return 1;
21  }
22 }
static const double lat
Definition: BFloat16.h:88
Header for GeographicLib::GravityModel class.
Math::real Gravity(real lat, real lon, real h, real &gx, real &gy, real &gz) const
Namespace for GeographicLib.
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Model of the earth&#39;s gravity field.
const double h
static const double lon


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