dotnet/examples/ManagedCPP/example-AlbersEqualArea.cpp
Go to the documentation of this file.
1 using namespace System;
2 using namespace NETGeographicLib;
3 
5 {
6  try {
7  const double
8  lat1 = 40 + 58/60.0, lat2 = 39 + 56/60.0, // standard parallels
9  k1 = 1, // scale
10  lon0 = -77 - 45/60.0; // Central meridian
11  // Set up basic projection
12  AlbersEqualArea^ albers = gcnew AlbersEqualArea( Constants::WGS84::MajorRadius,
13  Constants::WGS84::Flattening,
14  lat1, lat2, k1);
15  {
16  // Sample conversion from geodetic to Albers Equal Area
17  double lat = 39.95, lon = -75.17; // Philadelphia
18  double x, y;
19  albers->Forward(lon0, lat, lon, x, y);
20  Console::WriteLine( String::Format("X: {0} Y: {1}", x, y ) );
21  }
22  {
23  // Sample conversion from Albers Equal Area grid to geodetic
24  double x = 220e3, y = -53e3;
25  double lat, lon;
26  albers->Reverse(lon0, x, y, lat, lon);
27  Console::WriteLine( String::Format("Latitude: {0} Longitude: {1}", lat, lon ) );
28  }
29  }
30  catch (GeographicErr^ e) {
31  Console::WriteLine( String::Format( "Caught exception: {0}", e->Message ) );
32  return -1;
33  }
34  return 0;
35 }
NETGeographicLib::AlbersEqualArea::Reverse
void Reverse(double lon0, double x, double y, [System::Runtime::InteropServices::Out] double% lat, [System::Runtime::InteropServices::Out] double% lon, [System::Runtime::InteropServices::Out] double% gamma, [System::Runtime::InteropServices::Out] double% k)
Definition: dotnet/NETGeographicLib/AlbersEqualArea.cpp:136
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
main
int main(array< System::String ^> ^)
Definition: dotnet/examples/ManagedCPP/example-AlbersEqualArea.cpp:4
NETGeographicLib::AlbersEqualArea::Forward
void Forward(double lon0, double lat, double lon, [System::Runtime::InteropServices::Out] double% x, [System::Runtime::InteropServices::Out] double% y, [System::Runtime::InteropServices::Out] double% gamma, [System::Runtime::InteropServices::Out] double% k)
Definition: dotnet/NETGeographicLib/AlbersEqualArea.cpp:121
example::lon0
const double lon0
Definition: testGPSFactor.cpp:41
k1
double k1(double x)
Definition: k1.c:133
NETGeographicLib::AlbersEqualArea
.NET Wrapper for GeographicLib::AlbersEqualArea.
Definition: AlbersEqualArea.h:67
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