examples/example-Geoid.cpp
Go to the documentation of this file.
1 // Example of using the GeographicLib::Geoid class
2 
3 #include <iostream>
4 #include <exception>
6 
7 using namespace std;
8 using namespace GeographicLib;
9 
10 int main() {
11  try {
12  Geoid egm96("egm96-5");
13  // Convert height above egm96 to height above the ellipsoid
14  double lat = 42, lon = -75, height_above_geoid = 20;
15  double
16  geoid_height = egm96(lat, lon),
17  height_above_ellipsoid = (height_above_geoid +
18  Geoid::GEOIDTOELLIPSOID * geoid_height);
19  cout << height_above_ellipsoid << "\n";
20  }
21  catch (const exception& e) {
22  cerr << "Caught exception: " << e.what() << "\n";
23  return 1;
24  }
25 }
static const double lat
Definition: Half.h:150
Namespace for GeographicLib.
Array< double, 1, 3 > e(1./3., 0.5, 2.)
int main()
static const double lon
Header for GeographicLib::Geoid class.
Looking up the height of the geoid above the ellipsoid.
Definition: Geoid.hpp:82


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