gtsam
3rdparty
GeographicLib
dotnet
examples
ManagedCPP
dotnet/examples/ManagedCPP/example-PolygonArea.cpp
Go to the documentation of this file.
1
using namespace
System;
2
using namespace
NETGeographicLib
;
3
4
int
main
(
array<System::String ^>
^
/*args*/
)
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
}
main
int main(array< System::String ^> ^)
Definition:
dotnet/examples/ManagedCPP/example-PolygonArea.cpp:4
e
Array< double, 1, 3 > e(1./3., 0.5, 2.)
NETGeographicLib::GeographicErr
Exception class for NETGeographicLib.
Definition:
NETGeographicLib.h:132
n
int n
Definition:
BiCGSTAB_simple.cpp:1
NETGeographicLib::PolygonArea
.NET wrapper for GeographicLib::PolygonArea and PolygonAreaExact.
Definition:
PolygonArea.h:49
NETGeographicLib::Geodesic
.NET wrapper for GeographicLib::Geodesic.
Definition:
Geodesic.h:170
NETGeographicLib::PolygonArea::AddPoint
void AddPoint(double lat, double lon)
Definition:
dotnet/NETGeographicLib/PolygonArea.cpp:67
array
Definition:
numpy.h:821
NETGeographicLib
Definition:
Accumulator.h:13
NETGeographicLib::PolygonArea::Compute
unsigned Compute(bool reverse, bool sign, [System::Runtime::InteropServices::Out] double% perimeter, [System::Runtime::InteropServices::Out] double% area)
Definition:
dotnet/NETGeographicLib/PolygonArea.cpp:79
gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:11:31