dotnet/examples/ManagedCPP/example-PolygonArea.cpp
Go to the documentation of this file.
1 using namespace System;
2 using namespace NETGeographicLib;
3 
5 {
6  try {
7  Geodesic^ geod = gcnew Geodesic(); // WGS84
8  PolygonArea^ poly = gcnew PolygonArea(geod, true);
9  poly->AddPoint( 52, 0); // London
10  poly->AddPoint( 41,-74); // New York
11  poly->AddPoint(-23,-43); // Rio de Janeiro
12  poly->AddPoint(-26, 28); // Johannesburg
13  double perimeter, area;
14  unsigned int n = poly->Compute(false, true, perimeter, area);
15  Console::WriteLine(String::Format("{0} {1} {2}", n, perimeter, area));
16  }
17  catch (GeographicErr^ e) {
18  Console::WriteLine(String::Format("Caught exception: {0}", e->Message));
19  return -1;
20  }
21  return 0;
22 }
Exception class for NETGeographicLib.
Definition: numpy.h:543
int n
.NET wrapper for GeographicLib::PolygonArea and PolygonAreaExact.
Definition: PolygonArea.h:49
.NET wrapper for GeographicLib::Geodesic.
Definition: Geodesic.h:170
unsigned Compute(bool reverse, bool sign, [System::Runtime::InteropServices::Out] double%perimeter, [System::Runtime::InteropServices::Out] double%area)
int main(array< System::String^>^)
Array< double, 1, 3 > e(1./3., 0.5, 2.)


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