dotnet/examples/ManagedCPP/example-OSGB.cpp
Go to the documentation of this file.
1 using namespace System;
2 using namespace NETGeographicLib;
3 
5 {
6  try {
7  {
8  // Sample forward calculation from
9  // A guide to coordinate systems in Great Britain
10  double
11  lat = DMS::Decode(52,39,27.2531),
12  lon = DMS::Decode( 1,43, 4.5177);
13  double x, y;
14  OSGB::Forward(lat, lon, x, y);
15  String^ gridref;
16  OSGB::GridReference(x, y, 2, gridref);
17  Console::WriteLine(String::Format("{0} {1} {2}", x, y, gridref));
18  }
19  {
20  // Sample reverse calculation
21  String^ gridref = "TG5113";
22  double x, y;
23  int prec;
24  OSGB::GridReference(gridref, x, y, prec, true);
25  double lat, lon;
26  OSGB::Reverse(x, y, lat, lon);
27  Console::WriteLine(String::Format("{0} {1} {2}", prec, lat, lon));
28  }
29  }
30  catch (GeographicErr^ e) {
31  Console::WriteLine(String::Format("Caught exception: {0}", e->Message));
32  return 0;
33  }
34  return 0;
35 }
Scalar * y
static const double lat
int main(array< System::String^>^)
Exception class for NETGeographicLib.
Definition: numpy.h:543
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