dotnet/examples/ManagedCPP/example-Geoid.cpp
Go to the documentation of this file.
1 using namespace System;
2 using namespace NETGeographicLib;
3 
5 {
6  try {
7  Geoid^ egm96 = gcnew Geoid("egm96-5", "", true, false);
8  // Convert height above egm96 to height above the ellipsoid
9  double lat = 42, lon = -75, height_above_geoid = 20;
10  double
11  geoid_height = egm96->Height(lat, lon),
12  height_above_ellipsoid = (height_above_geoid +
13  (double)Geoid::ConvertFlag::GEOIDTOELLIPSOID * geoid_height);
14  Console::WriteLine(height_above_ellipsoid);
15  }
16  catch (GeographicErr^ e) {
17  Console::WriteLine(String::Format("Caught exception: {0}", e->Message));
18  return -1;
19  }
20  return 0;
21 }
int main(array< System::String^>^)
static const double lat
Exception class for NETGeographicLib.
Definition: numpy.h:543
Array< double, 1, 3 > e(1./3., 0.5, 2.)
double Height(double lat, double lon)
static const double lon
.NET wrapper for GeographicLib::Geoid.
Definition: Geoid.h:71


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