dotnet/examples/ManagedCPP/example-TransverseMercator.cpp
Go to the documentation of this file.
1 using namespace System;
2 using namespace NETGeographicLib;
3 
5 {
6  try {
7  TransverseMercator^ proj = gcnew TransverseMercator(); // WGS84
8  double lon0 = -75; // Central meridian for UTM zone 18
9  {
10  // Sample forward calculation
11  double lat = 40.3, lon = -74.7; // Princeton, NJ
12  double x, y;
13  proj->Forward(lon0, lat, lon, x, y);
14  Console::WriteLine(String::Format("{0} {1}", x, y));
15  }
16  {
17  // Sample reverse calculation
18  double x = 25e3, y = 4461e3;
19  double lat, lon;
20  proj->Reverse(lon0, x, y, lat, lon);
21  Console::WriteLine(String::Format("{0} {1}", lat, lon));
22  }
23  }
24  catch (GeographicErr^ e) {
25  Console::WriteLine(String::Format("Caught exception: {0}", e->Message));
26  return -1;
27  }
28  return 0;
29 }
main
int main(array< System::String ^> ^)
Definition: dotnet/examples/ManagedCPP/example-TransverseMercator.cpp:4
e
Array< double, 1, 3 > e(1./3., 0.5, 2.)
NETGeographicLib::TransverseMercator
.NET wrapper for GeographicLib::TransverseMercator.
Definition: TransverseMercator.h:77
x
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
Definition: gnuplot_common_settings.hh:12
NETGeographicLib::GeographicErr
Exception class for NETGeographicLib.
Definition: NETGeographicLib.h:132
NETGeographicLib::TransverseMercator::Forward
void Forward(double lon0, double lat, double lon, [System::Runtime::InteropServices::Out] double% x, [System::Runtime::InteropServices::Out] double% y, [System::Runtime::InteropServices::Out] double% gamma, [System::Runtime::InteropServices::Out] double% k)
Definition: dotnet/NETGeographicLib/TransverseMercator.cpp:62
example::lon0
const double lon0
Definition: testGPSFactor.cpp:41
y
Scalar * y
Definition: level1_cplx_impl.h:124
array
Definition: numpy.h:821
lon
static const double lon
Definition: testGeographicLib.cpp:34
NETGeographicLib::TransverseMercator::Reverse
void Reverse(double lon0, double x, double y, [System::Runtime::InteropServices::Out] double% lat, [System::Runtime::InteropServices::Out] double% lon, [System::Runtime::InteropServices::Out] double% gamma, [System::Runtime::InteropServices::Out] double% k)
Definition: dotnet/NETGeographicLib/TransverseMercator.cpp:77
NETGeographicLib
Definition: Accumulator.h:13
lat
static const double lat
Definition: testGeographicLib.cpp:34


gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:11:31