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 }
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
y
Scalar * y
Definition: level1_cplx_impl.h:124
array
Definition: numpy.h:821
main
int main(array< System::String ^> ^)
Definition: dotnet/examples/ManagedCPP/example-OSGB.cpp:4
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 Thu Jul 4 2024 03:01:21