dotnet/examples/ManagedCPP/example-GravityCircle.cpp
Go to the documentation of this file.
1 using namespace System;
2 using namespace NETGeographicLib;
3 
5 {
6  try {
7  GravityModel^ grav = gcnew GravityModel("egm96", "");
8  double lat = 27.99, lon0 = 86.93, h = 8820; // Mt Everest
9  {
10  // Slow method of evaluating the values at several points on a circle of
11  // latitude.
12  for (int i = -5; i <= 5; ++i) {
13  double lon = lon0 + i * 0.2;
14  double gx, gy, gz;
15  grav->Gravity(lat, lon, h, gx, gy, gz);
16  Console::WriteLine(String::Format("{0} {1} {2} {3}", lon, gx, gy, gz));
17  }
18  }
19  {
20  // Fast method of evaluating the values at several points on a circle of
21  // latitude using GravityCircle.
22  GravityCircle^ circ = grav->Circle(lat, h, GravityModel::Mask::ALL);
23  for (int i = -5; i <= 5; ++i) {
24  double lon = lon0 + i * 0.2;
25  double gx, gy, gz;
26  circ->Gravity(lon, gx, gy, gz);
27  Console::WriteLine(String::Format("{0} {1} {2} {3}", lon, gx, gy, gz));
28  }
29  }
30  }
31  catch (GeographicErr^ e) {
32  Console::WriteLine(String::Format("Caught exception: {0}", e->Message));
33  return -1;
34  }
35  return 0;
36 }
double Gravity(double lon, [System::Runtime::InteropServices::Out] double%gx, [System::Runtime::InteropServices::Out] double%gy, [System::Runtime::InteropServices::Out] double%gz)
static const double lat
.NET wrapper for GeographicLib::GravityCircle.
Definition: GravityCircle.h:45
Exception class for NETGeographicLib.
Definition: numpy.h:543
Array< double, 1, 3 > e(1./3., 0.5, 2.)
const double lon0
const double h
double Gravity(double lat, double lon, double h, [System::Runtime::InteropServices::Out] double%gx, [System::Runtime::InteropServices::Out] double%gy, [System::Runtime::InteropServices::Out] double%gz)
GravityCircle Circle(double lat, double h, Mask caps)
static const double lon
.NET wrapper for GeographicLib::GravityModel.
Definition: GravityModel.h:83
int main(array< System::String^>^)


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