Public Member Functions | Private Member Functions | Private Attributes | List of all members
NETGeographicLib::AzimuthalEquidistant Class Reference

.NET wrapper for GeographicLib::AzimuthalEquidistant. More...

#include <AzimuthalEquidistant.h>

Public Member Functions

 AzimuthalEquidistant (Geodesic^ earth)
 
 AzimuthalEquidistant (void)
 
void Forward (double lat0, double lon0, double lat, double lon, [System::Runtime::InteropServices::Out] double% x, [System::Runtime::InteropServices::Out] double% y)
 
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)
 
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)
 
 ~AzimuthalEquidistant ()
 

Public Attributes

Inspector functions
property double MajorRadius { double get()
 
property double Flattening { double get()
 

Private Member Functions

 !AzimuthalEquidistant ()
 

Private Attributes

const GeographicLib::AzimuthalEquidistantm_pAzimuthalEquidistant
 

Detailed Description

.NET wrapper for GeographicLib::AzimuthalEquidistant.

This class allows .NET applications to access GeographicLib::AzimuthalEquidistant.

Azimuthal equidistant projection centered at an arbitrary position on the ellipsoid. For a point in projected space (x, y), the geodesic distance from the center position is hypot(x, y) and the azimuth of the geodesic from the center point is atan2(x, y). The Forward and Reverse methods also return the azimuth azi of the geodesic at (x, y) and reciprocal scale rk in the azimuthal direction which, together with the basic properties of the projection, serve to specify completely the local affine transformation between geographic and projected coordinates.

The conversions all take place using a Geodesic object (by default Geodesic::WGS84). For more information on geodesics see geodesic.

C# Example:

using System;
namespace example_AzimuthalEquidistant
{
class Program
{
static void Main(string[] args)
{
try {
Geodesic geod = new Geodesic(); // WGS84
const double lat0 = 48 + 50/60.0, lon0 = 2 + 20/60.0; // Paris
{
// Sample forward calculation
double lat = 50.9, lon = 1.8; // Calais
double x, y;
proj.Forward(lat0, lon0, lat, lon, out x, out y);
Console.WriteLine( String.Format("X: {0} Y: {1}", x, y ) );
}
{
// Sample reverse calculation
double x = -38e3, y = 230e3;
double lat, lon;
proj.Reverse(lat0, lon0, x, y, out lat, out lon);
Console.WriteLine( String.Format("Latitude: {0} Longitude: {1}", lat, lon ) );
}
}
catch (GeographicErr e) {
Console.WriteLine( String.Format( "Caught exception: {0}", e.Message ) );
}
}
}
}

Managed C++ Example:

// Example of using the GeographicLib::AzimuthalEquidistant class
#include <iostream>
#include <exception>
using namespace std;
using namespace GeographicLib;
int main() {
try {
Geodesic geod(Constants::WGS84_a(), Constants::WGS84_f());
// Alternatively: const Geodesic& geod = Geodesic::WGS84();
const double lat0 = 48 + 50/60.0, lon0 = 2 + 20/60.0; // Paris
{
// Sample forward calculation
double lat = 50.9, lon = 1.8; // Calais
double x, y;
proj.Forward(lat0, lon0, lat, lon, x, y);
cout << x << " " << y << "\n";
}
{
// Sample reverse calculation
double x = -38e3, y = 230e3;
double lat, lon;
proj.Reverse(lat0, lon0, x, y, lat, lon);
cout << lat << " " << lon << "\n";
}
}
catch (const exception& e) {
cerr << "Caught exception: " << e.what() << "\n";
return 1;
}
}

Visual Basic Example:

Imports NETGeographicLib
Module example_AzimuthalEquidistant
Sub Main()
Try
Dim geod As Geodesic = New Geodesic() ' WGS84
Dim lat0 As Double = 48 + 50 / 60.0, lon0 = 2 + 20 / 60.0 ' Paris
Dim proj As AzimuthalEquidistant = New AzimuthalEquidistant(geod)
' Sample forward calculation
Dim lat As Double = 50.9, lon = 1.8 ' Calais
Dim x, y As Double
proj.Forward(lat0, lon0, lat, lon, x, y)
Console.WriteLine(String.Format("X: {0} Y: {1}", x, y))
' Sample reverse calculation
x = -38000.0 : y = 230000.0
proj.Reverse(lat0, lon0, x, y, lat, lon)
Console.WriteLine(String.Format("Latitude: {0} Longitude: {1}", lat, lon))
Catch ex As GeographicErr
Console.WriteLine(String.Format("Caught exception: {0}", ex.Message))
End Try
End Sub
End Module

INTERFACE DIFFERENCES:
A default constructor is provided that assumes a WGS84 ellipsoid.

The MajorRadius and Flattening functions are implemented as properties.

Definition at line 47 of file AzimuthalEquidistant.h.

Constructor & Destructor Documentation

◆ !AzimuthalEquidistant()

AzimuthalEquidistant::!AzimuthalEquidistant ( )
private

◆ AzimuthalEquidistant() [1/2]

AzimuthalEquidistant::AzimuthalEquidistant ( void  )

Default Constructor for AzimuthalEquidistant. Assumes WGS84 Geodesic

Definition at line 31 of file dotnet/NETGeographicLib/AzimuthalEquidistant.cpp.

◆ AzimuthalEquidistant() [2/2]

AzimuthalEquidistant::AzimuthalEquidistant ( Geodesic earth)

Constructor for AzimuthalEquidistant.

Parameters
[in]earththe Geodesic object to use for geodesic calculations.

Definition at line 44 of file dotnet/NETGeographicLib/AzimuthalEquidistant.cpp.

◆ ~AzimuthalEquidistant()

NETGeographicLib::AzimuthalEquidistant::~AzimuthalEquidistant ( )
inline

Destructor

frees unmanaged memory.

Definition at line 74 of file AzimuthalEquidistant.h.

Member Function Documentation

◆ Forward() [1/2]

void AzimuthalEquidistant::Forward ( double  lat0,
double  lon0,
double  lat,
double  lon,
[System::Runtime::InteropServices::Out] double%  x,
[System::Runtime::InteropServices::Out] double%  y 
)

AzimuthalEquidistant::Forward without returning the azimuth and scale.

Definition at line 85 of file dotnet/NETGeographicLib/AzimuthalEquidistant.cpp.

◆ Forward() [2/2]

void AzimuthalEquidistant::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 
)

Forward projection, from geographic to azimuthal equidistant.

Parameters
[in]lat0latitude of center point of projection (degrees).
[in]lon0longitude of center point of projection (degrees).
[in]latlatitude of point (degrees).
[in]lonlongitude of point (degrees).
[out]xeasting of point (meters).
[out]ynorthing of point (meters).
[out]aziazimuth of geodesic at point (degrees).
[out]rkreciprocal of azimuthal scale at point.

lat0 and lat should be in the range [−90°, 90°]. The scale of the projection is 1 in the "radial" direction, azi clockwise from true north, and is 1/rk in the direction perpendicular to this. A call to Forward followed by a call to Reverse will return the original (lat, lon) (to within roundoff).

Definition at line 60 of file dotnet/NETGeographicLib/AzimuthalEquidistant.cpp.

◆ Reverse() [1/2]

void AzimuthalEquidistant::Reverse ( double  lat0,
double  lon0,
double  x,
double  y,
[System::Runtime::InteropServices::Out] double%  lat,
[System::Runtime::InteropServices::Out] double%  lon 
)

AzimuthalEquidistant::Reverse without returning the azimuth and scale.

Definition at line 95 of file dotnet/NETGeographicLib/AzimuthalEquidistant.cpp.

◆ Reverse() [2/2]

void AzimuthalEquidistant::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 
)

Reverse projection, from azimuthal equidistant to geographic.

Parameters
[in]lat0latitude of center point of projection (degrees).
[in]lon0longitude of center point of projection (degrees).
[in]xeasting of point (meters).
[in]ynorthing of point (meters).
[out]latlatitude of point (degrees).
[out]lonlongitude of point (degrees).
[out]aziazimuth of geodesic at point (degrees).
[out]rkreciprocal of azimuthal scale at point.

lat0 should be in the range [−90°, 90°]. lat will be in the range [−90°, 90°] and lon will be in the range [−180°, 180°). The scale of the projection is 1 in the "radial" direction, azi clockwise from true north, and is 1/rk in the direction perpendicular to this. A call to Reverse followed by a call to Forward will return the original (x, y) (to roundoff) only if the geodesic to (x, y) is a shortest path.

Definition at line 73 of file dotnet/NETGeographicLib/AzimuthalEquidistant.cpp.

Member Data Documentation

◆ Flattening

property double NETGeographicLib::AzimuthalEquidistant::Flattening { double get()
Returns
f the flattening of the ellipsoid. This is the value inherited from the Geodesic object used in the constructor.

Definition at line 156 of file AzimuthalEquidistant.h.

◆ m_pAzimuthalEquidistant

const GeographicLib::AzimuthalEquidistant* NETGeographicLib::AzimuthalEquidistant::m_pAzimuthalEquidistant
private

Definition at line 51 of file AzimuthalEquidistant.h.

◆ MajorRadius

property double NETGeographicLib::AzimuthalEquidistant::MajorRadius { double get()
Returns
a the equatorial radius of the ellipsoid (meters). This is the value inherited from the Geodesic object used in the constructor.

Definition at line 150 of file AzimuthalEquidistant.h.


The documentation for this class was generated from the following files:
e
Array< double, 1, 3 > e(1./3., 0.5, 2.)
GeographicLib
Namespace for GeographicLib.
Definition: JacobiConformal.hpp:15
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
main
int main(int argc, char **argv)
Definition: cmake/example_cmake_find_gtsam/main.cpp:63
AzimuthalEquidistant.hpp
Header for GeographicLib::AzimuthalEquidistant class.
example::lat0
const double lat0
Definition: testGPSFactor.cpp:41
example::lon0
const double lon0
Definition: testGPSFactor.cpp:41
GeographicLib::AzimuthalEquidistant
Azimuthal equidistant projection.
Definition: AzimuthalEquidistant.hpp:42
out
std::ofstream out("Result.txt")
y
Scalar * y
Definition: level1_cplx_impl.h:124
std
Definition: BFloat16.h:88
args
Definition: pytypes.h:2210
lon
static const double lon
Definition: testGeographicLib.cpp:34
NETGeographicLib::AzimuthalEquidistant::AzimuthalEquidistant
AzimuthalEquidistant(void)
Definition: dotnet/NETGeographicLib/AzimuthalEquidistant.cpp:31
NETGeographicLib
Definition: Accumulator.h:13
GeographicLib::Geodesic
Geodesic calculations
Definition: Geodesic.hpp:172
Geodesic.hpp
Header for GeographicLib::Geodesic class.
lat
static const double lat
Definition: testGeographicLib.cpp:34


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