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;
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;
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 //*****************************************************************************
106 { return m_pAzimuthalEquidistant->MajorRadius(); }
107 
108 //*****************************************************************************
110 { return m_pAzimuthalEquidistant->Flattening(); }
GeographicLib::AzimuthalEquidistant::Forward
void Forward(real lat0, real lon0, real lat, real lon, real &x, real &y, real &azi, real &rk) const
Definition: src/AzimuthalEquidistant.cpp:20
GeographicLib::Geodesic::WGS84
static const Geodesic & WGS84()
Definition: src/Geodesic.cpp:89
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::AzimuthalEquidistant
.NET wrapper for GeographicLib::AzimuthalEquidistant.
Definition: AzimuthalEquidistant.h:47
NETGeographicLib::GeographicErr
Exception class for NETGeographicLib.
Definition: NETGeographicLib.h:132
NETGeographicLib::AzimuthalEquidistant::Forward
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)
Definition: dotnet/NETGeographicLib/AzimuthalEquidistant.cpp:60
AzimuthalEquidistant.hpp
Header for GeographicLib::AzimuthalEquidistant class.
BADALLOC
const char BADALLOC[]
Definition: dotnet/NETGeographicLib/AzimuthalEquidistant.cpp:18
example::lat0
const double lat0
Definition: testGPSFactor.cpp:41
example::lon0
const double lon0
Definition: testGPSFactor.cpp:41
NETGeographicLib::AzimuthalEquidistant::Reverse
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)
Definition: dotnet/NETGeographicLib/AzimuthalEquidistant.cpp:73
NETGeographicLib::Geodesic
.NET wrapper for GeographicLib::Geodesic.
Definition: Geodesic.h:170
stdafx.h
GeographicLib::AzimuthalEquidistant
Azimuthal equidistant projection.
Definition: AzimuthalEquidistant.hpp:42
NETGeographicLib.h
Header for NETGeographicLib::NETGeographicLib objects.
g
void g(const string &key, int i)
Definition: testBTree.cpp:41
NETGeographicLib::AzimuthalEquidistant::m_pAzimuthalEquidistant
const GeographicLib::AzimuthalEquidistant * m_pAzimuthalEquidistant
Definition: AzimuthalEquidistant.h:51
y
Scalar * y
Definition: level1_cplx_impl.h:124
GeographicLib::AzimuthalEquidistant::Reverse
void Reverse(real lat0, real lon0, real x, real y, real &lat, real &lon, real &azi, real &rk) const
Definition: src/AzimuthalEquidistant.cpp:30
AzimuthalEquidistant.h
Header for NETGeographicLib::AzimuthalEquidistant class.
lon
static const double lon
Definition: testGeographicLib.cpp:34
NULL
#define NULL
Definition: ccolamd.c:609
NETGeographicLib::AzimuthalEquidistant::AzimuthalEquidistant
AzimuthalEquidistant(void)
Definition: dotnet/NETGeographicLib/AzimuthalEquidistant.cpp:31
get
Container::iterator get(Container &c, Position position)
Definition: stdlist_overload.cpp:29
NETGeographicLib
Definition: Accumulator.h:13
GeographicLib::Geodesic
Geodesic calculations
Definition: Geodesic.hpp:172
lat
static const double lat
Definition: testGeographicLib.cpp:34


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:01:53