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 }
e
Array< double, 1, 3 > e(1./3., 0.5, 2.)
GeographicLib
Namespace for GeographicLib.
Definition: JacobiConformal.hpp:15
Geoid.hpp
Header for GeographicLib::Geoid class.
GeographicLib::Geoid
Looking up the height of the geoid above the ellipsoid.
Definition: Geoid.hpp:82
std
Definition: BFloat16.h:88
main
int main()
Definition: examples/example-Geoid.cpp:10
lon
static const double lon
Definition: testGeographicLib.cpp:34
lat
static const double lat
Definition: testGeographicLib.cpp:34


gtsam
Author(s):
autogenerated on Mon Jul 1 2024 03:01:15