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 }
Scalar * y
static const double lat
Exception class for NETGeographicLib.
Definition: numpy.h:543
int main(array< System::String^>^)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
static const double lon
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


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