dotnet/NETGeographicLib/AzimuthalEquidistant.cpp
Go to the documentation of this file.
1 
11 #include "stdafx.h"
13 #include "AzimuthalEquidistant.h"
14 #include "NETGeographicLib.h"
15 
16 using namespace NETGeographicLib;
17 
18 const char BADALLOC[] = "Failed to allocate memory for a GeographicLib::AzimuthalEquidistant";
19 
20 //*****************************************************************************
22 {
23  if ( m_pAzimuthalEquidistant != NULL )
24  {
25  delete m_pAzimuthalEquidistant;
26  m_pAzimuthalEquidistant = NULL;
27  }
28 }
29 
30 //*****************************************************************************
32 {
33  try
34  {
36  }
37  catch ( std::bad_alloc )
38  {
39  throw gcnew GeographicErr( BADALLOC );
40  }
41 }
42 
43 //*****************************************************************************
45 {
46  try
47  {
48  const GeographicLib::Geodesic* pGeodesic =
49  reinterpret_cast<const GeographicLib::Geodesic*>(
50  g->GetUnmanaged()->ToPointer() );
52  }
53  catch ( std::bad_alloc )
54  {
55  throw gcnew GeographicErr( BADALLOC );
56  }
57 }
58 
59 //*****************************************************************************
60 void AzimuthalEquidistant::Forward(double lat0, double lon0, double lat, double lon,
61  double% x, double% y, double% azi, double% rk)
62 {
63  double lx, ly, lazi, lrk;
64  m_pAzimuthalEquidistant->Forward( lat0, lon0, lat, lon,
65  lx, ly, lazi, lrk );
66  x = lx;
67  y = ly;
68  azi = lazi;
69  rk = lrk;
70 }
71 
72 //*****************************************************************************
73 void AzimuthalEquidistant::Reverse(double lat0, double lon0, double x, double y,
74  double% lat, double% lon, double% azi, double% rk)
75 {
76  double llat, llon, lazi, lrk;
77  m_pAzimuthalEquidistant->Reverse(lat0, lon0, x, y,
78  llat, llon, lazi, lrk);
79  lat = llat;
80  lon = llon;
81  azi = lazi;
82  rk = lrk;
83 }
84 //*****************************************************************************
85 void AzimuthalEquidistant::Forward(double lat0, double lon0, double lat, double lon,
86  double% x, double% y)
87 {
88  double azi, rk, lx, ly;
89  m_pAzimuthalEquidistant->Forward(lat0, lon0, lat, lon, lx, ly, azi, rk);
90  x = lx;
91  y = ly;
92 }
93 
94 //*****************************************************************************
95 void AzimuthalEquidistant::Reverse(double lat0, double lon0, double x, double y,
96  double% lat, double% lon)
97 {
98  double azi, rk, llat, llon;
99  m_pAzimuthalEquidistant->Reverse(lat0, lon0, x, y, llat, llon, azi, rk);
100  lat = llat;
101  lon = llon;
102 }
103 
104 //*****************************************************************************
107 
108 //*****************************************************************************
110 { return m_pAzimuthalEquidistant->Flattening(); }
Header for NETGeographicLib::NETGeographicLib objects.
Scalar * y
static const double lat
static const Geodesic & WGS84()
Exception class for NETGeographicLib.
void Forward(real lat0, real lon0, real lat, real lon, real &x, real &y, real &azi, real &rk) const
void g(const string &key, int i)
Definition: testBTree.cpp:41
const double lat0
.NET wrapper for GeographicLib::Geodesic.
Definition: Geodesic.h:170
Azimuthal equidistant projection.
void Reverse(real lat0, real lon0, real x, real y, real &lat, real &lon, real &azi, real &rk) const
const double lon0
.NET wrapper for GeographicLib::AzimuthalEquidistant.
#define NULL
Definition: ccolamd.c:609
void Forward(double lat0, double lon0, double lat, double lon, [System::Runtime::InteropServices::Out] double% x, [System::Runtime::InteropServices::Out] double% y, [System::Runtime::InteropServices::Out] double% azi, [System::Runtime::InteropServices::Out] double% rk)
void Reverse(double lat0, double lon0, double x, double y, [System::Runtime::InteropServices::Out] double% lat, [System::Runtime::InteropServices::Out] double% lon, [System::Runtime::InteropServices::Out] double% azi, [System::Runtime::InteropServices::Out] double% rk)
static const double lon
Container::iterator get(Container &c, Position position)
const GeographicLib::AzimuthalEquidistant * m_pAzimuthalEquidistant
Header for GeographicLib::AzimuthalEquidistant class.
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
Header for NETGeographicLib::AzimuthalEquidistant class.
Geodesic calculations
Definition: Geodesic.hpp:172


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:33:56