dotnet/examples/ManagedCPP/example-LocalCartesian.cpp
Go to the documentation of this file.
1 using namespace System;
2 using namespace NETGeographicLib;
3 
5 {
6  try {
7  Geocentric^ earth = gcnew Geocentric();
8  const double lat0 = 48 + 50/60.0, lon0 = 2 + 20/60.0; // Paris
9  LocalCartesian^ proj = gcnew LocalCartesian(lat0, lon0, 0, earth);
10  {
11  // Sample forward calculation
12  double lat = 50.9, lon = 1.8, h = 0; // Calais
13  double x, y, z;
14  proj->Forward(lat, lon, h, x, y, z);
15  Console::WriteLine(String::Format("{0} {1} {2}", x, y, z));
16  }
17  {
18  // Sample reverse calculation
19  double x = -38e3, y = 230e3, z = -4e3;
20  double lat, lon, h;
21  proj->Reverse(x, y, z, lat, lon, h);
22  Console::WriteLine(String::Format("{0} {1} {2}", lat, lon, h));
23  }
24  }
25  catch (GeographicErr^ e) {
26  Console::WriteLine(String::Format("Caught exception: {0}", e->Message));
27  return -1;
28  }
29  return 0;
30 }
main
int main(array< System::String ^> ^)
Definition: dotnet/examples/ManagedCPP/example-LocalCartesian.cpp:4
NETGeographicLib::Geocentric
.NET wrapper for GeographicLib::Geocentric.
Definition: Geocentric.h:68
e
Array< double, 1, 3 > e(1./3., 0.5, 2.)
NETGeographicLib::LocalCartesian::Reverse
void Reverse(double x, double y, double z, [System::Runtime::InteropServices::Out] double% lat, [System::Runtime::InteropServices::Out] double% lon, [System::Runtime::InteropServices::Out] double% h)
Definition: dotnet/NETGeographicLib/LocalCartesian.cpp:131
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::LocalCartesian
.NET wrapper for GeographicLib::LocalCartesian.
Definition: LocalCartesian.h:48
h
const double h
Definition: testSimpleHelicopter.cpp:19
NETGeographicLib::LocalCartesian::Forward
void Forward(double lat, double lon, double h, [System::Runtime::InteropServices::Out] double% x, [System::Runtime::InteropServices::Out] double% y, [System::Runtime::InteropServices::Out] double% z)
Definition: dotnet/NETGeographicLib/LocalCartesian.cpp:99
NETGeographicLib::GeographicErr
Exception class for NETGeographicLib.
Definition: NETGeographicLib.h:132
example::lat0
const double lat0
Definition: testGPSFactor.cpp:41
example::lon0
const double lon0
Definition: testGPSFactor.cpp:41
pybind_wrapper_test_script.z
z
Definition: pybind_wrapper_test_script.py:61
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