dotnet/examples/ManagedCPP/example-UTMUPS.cpp
Go to the documentation of this file.
1 using namespace System;
2 using namespace NETGeographicLib;
3 
5 {
6  try {
7  // See also example-GeoCoords.cpp
8  {
9  // Sample forward calculation
10  double lat = 33.3, lon = 44.4; // Baghdad
11  int zone;
12  bool northp;
13  double x, y;
14  UTMUPS::Forward(lat, lon, zone, northp, x, y, -1, true);
15  String^ zonestr = UTMUPS::EncodeZone(zone, northp, true);
16  Console::WriteLine(String::Format("{0} {1} {2}", zonestr, x, y));
17  }
18  {
19  // Sample reverse calculation
20  String^ zonestr = "38N";
21  int zone;
22  bool northp;
23  UTMUPS::DecodeZone(zonestr, zone, northp);
24  double x = 444e3, y = 3688e3;
25  double lat, lon;
26  UTMUPS::Reverse(zone, northp, x, y, lat, lon, true);
27  Console::WriteLine(String::Format("{0} {1}", lat,lon));
28  }
29  }
30  catch (GeographicErr^ e) {
31  Console::WriteLine(String::Format("Caught exception: {0}", e->Message));
32  return -1;
33  }
34  return 0;
35 }
Eigen::Forward
@ Forward
Definition: NumericalDiff.h:19
e
Array< double, 1, 3 > e(1./3., 0.5, 2.)
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
main
int main(array< System::String ^> ^)
Definition: dotnet/examples/ManagedCPP/example-UTMUPS.cpp:4
y
Scalar * y
Definition: level1_cplx_impl.h:124
array
Definition: numpy.h:821
lon
static const double lon
Definition: testGeographicLib.cpp:34
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