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

.NET wrapper for GeographicLib::PolarStereographic. More...

#include <PolarStereographic.h>

Public Member Functions

void Forward (bool northp, double lat, double lon, [System::Runtime::InteropServices::Out] double% x, [System::Runtime::InteropServices::Out] double% y)
 
void Forward (bool northp, 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)
 
 PolarStereographic ()
 
 PolarStereographic (double a, double f, double k0)
 
void Reverse (bool northp, double x, double y, [System::Runtime::InteropServices::Out] double% lat, [System::Runtime::InteropServices::Out] double% lon)
 
void Reverse (bool northp, 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)
 
void SetScale (double lat, double k)
 
 ~PolarStereographic ()
 

Public Attributes

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

Private Member Functions

 !PolarStereographic (void)
 

Private Attributes

GeographicLib::PolarStereographicm_pPolarStereographic
 

Detailed Description

.NET wrapper for GeographicLib::PolarStereographic.

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

.NET wrapper for GeographicLib::PolarStereographic.

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

Implementation taken from the report,

This is a straightforward implementation of the equations in Snyder except that Newton's method is used to invert the projection.

C# Example:

using System;
namespace example_PolarStereographic
{
class Program
{
static void Main(string[] args)
{
try {
PolarStereographic proj = new PolarStereographic(); // WGS84
bool northp = true;
{
// Sample forward calculation
double lat = 61.2, lon = -149.9; // Anchorage
double x, y;
proj.Forward(northp, lat, lon, out x, out y);
Console.WriteLine(String.Format("{0} {1}", x, y));
}
{
// Sample reverse calculation
double x = -1637e3, y = 2824e3;
double lat, lon;
proj.Reverse(northp, x, y, out lat, out lon);
Console.WriteLine(String.Format("{0} {1}", lat, lon));
}
}
catch (GeographicErr e) {
Console.WriteLine(String.Format("Caught exception: {0}", e.Message));
}
}
}
}

Managed C++ Example:

// Example of using the GeographicLib::PolarStereographic class
#include <iostream>
#include <iomanip>
#include <exception>
using namespace std;
using namespace GeographicLib;
int main() {
try {
PolarStereographic proj(Constants::WGS84_a(), Constants::WGS84_f(),
Constants::UPS_k0());
// Alternatively:
// const PolarStereographic& proj = PolarStereographic::UPS();
bool northp = true;
{
// Sample forward calculation
double lat = 61.2, lon = -149.9; // Anchorage
double x, y;
proj.Forward(northp, lat, lon, x, y);
cout << x << " " << y << "\n";
}
{
// Sample reverse calculation
double x = -1637e3, y = 2824e3;
double lat, lon;
proj.Reverse(northp, 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_PolarStereographic
Sub Main()
Try
Dim proj As PolarStereographic = New PolarStereographic() ' WGS84
Dim northp As Boolean = True
' Sample forward calculation
Dim lat As Double = 61.2, lon = -149.9 ' Anchorage
Dim x, y As Double
proj.Forward(northp, lat, lon, x, y)
Console.WriteLine(String.Format("{0} {1}", x, y))
' Sample reverse calculation
x = -1637000.0 : y = 2824000.0
proj.Reverse(northp, x, y, lat, lon)
Console.WriteLine(String.Format("{0} {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 WGS84 parameters and a UPS scale factor.

The MajorRadius, Flattening, and CentralScale functions are implemented as properties.

Definition at line 48 of file PolarStereographic.h.

Constructor & Destructor Documentation

◆ !PolarStereographic()

PolarStereographic::!PolarStereographic ( void  )
private

◆ PolarStereographic() [1/2]

PolarStereographic::PolarStereographic ( double  a,
double  f,
double  k0 
)

Constructor for a ellipsoid with

Parameters
[in]aequatorial radius (meters).
[in]fflattening of ellipsoid. Setting f = 0 gives a sphere. Negative f gives a prolate ellipsoid.
[in]k0central scale factor.
Exceptions
GeographicErrif a, (1 − f ) a, or k0 is not positive.

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

◆ PolarStereographic() [2/2]

PolarStereographic::PolarStereographic ( )

An instantiation of PolarStereographic with the WGS84 ellipsoid and the UPS scale factor.

Definition at line 48 of file dotnet/NETGeographicLib/PolarStereographic.cpp.

◆ ~PolarStereographic()

NETGeographicLib::PolarStereographic::~PolarStereographic ( )
inline

The destructor calls the finalizer.

Definition at line 79 of file PolarStereographic.h.

Member Function Documentation

◆ Forward() [1/2]

void PolarStereographic::Forward ( bool  northp,
double  lat,
double  lon,
[System::Runtime::InteropServices::Out] double%  x,
[System::Runtime::InteropServices::Out] double%  y 
)

PolarStereographic::Forward without returning the convergence and scale.

Definition at line 107 of file dotnet/NETGeographicLib/PolarStereographic.cpp.

◆ Forward() [2/2]

void PolarStereographic::Forward ( bool  northp,
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 
)

Forward projection, from geographic to polar stereographic.

Parameters
[in]northpthe pole which is the center of projection (true means north, false means south).
[in]latlatitude of point (degrees).
[in]lonlongitude of point (degrees).
[out]xeasting of point (meters).
[out]ynorthing of point (meters).
[out]gammameridian convergence at point (degrees).
[out]kscale of projection at point.

No false easting or northing is added. lat should be in the range (−90°, 90°] for northp = true and in the range [−90°, 90°) for northp = false.

Definition at line 75 of file dotnet/NETGeographicLib/PolarStereographic.cpp.

◆ Reverse() [1/2]

void PolarStereographic::Reverse ( bool  northp,
double  x,
double  y,
[System::Runtime::InteropServices::Out] double%  lat,
[System::Runtime::InteropServices::Out] double%  lon 
)

PolarStereographic::Reverse without returning the convergence and scale.

Definition at line 118 of file dotnet/NETGeographicLib/PolarStereographic.cpp.

◆ Reverse() [2/2]

void PolarStereographic::Reverse ( bool  northp,
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 
)

Reverse projection, from polar stereographic to geographic.

Parameters
[in]northpthe pole which is the center of projection (true means north, false means south).
[in]xeasting of point (meters).
[in]ynorthing of point (meters).
[out]latlatitude of point (degrees).
[out]lonlongitude of point (degrees).
[out]gammameridian convergence at point (degrees).
[out]kscale of projection at point.

No false easting or northing is added. The value of lon returned is in the range [−180°, 180°).

Definition at line 91 of file dotnet/NETGeographicLib/PolarStereographic.cpp.

◆ SetScale()

void PolarStereographic::SetScale ( double  lat,
double  k 
)

Set the scale for the projection.

Parameters
[in]lat(degrees) assuming northp = true.
[in]kscale at latitude lat
Exceptions
GeographicErrk is not positive.
GeographicErrif lat is not in (−90°, 90°] or this object was created with the default constructor.

Definition at line 62 of file dotnet/NETGeographicLib/PolarStereographic.cpp.

Member Data Documentation

◆ CentralScale

property double NETGeographicLib::PolarStereographic::CentralScale { double get()

The central scale for the projection. This is the value of k0 used in the constructor and is the scale at the pole unless overridden by PolarStereographic::SetScale.

Definition at line 170 of file PolarStereographic.h.

◆ Flattening

property double NETGeographicLib::PolarStereographic::Flattening { double get()
Returns
f the flattening of the ellipsoid. This is the value used in the constructor.

Definition at line 163 of file PolarStereographic.h.

◆ m_pPolarStereographic

GeographicLib::PolarStereographic* NETGeographicLib::PolarStereographic::m_pPolarStereographic
private

Definition at line 52 of file PolarStereographic.h.

◆ MajorRadius

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

Definition at line 157 of file PolarStereographic.h.


The documentation for this class was generated from the following files:
PolarStereographic.hpp
Header for GeographicLib::PolarStereographic class.
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
NETGeographicLib::PolarStereographic::PolarStereographic
PolarStereographic()
Definition: dotnet/NETGeographicLib/PolarStereographic.cpp:48
out
std::ofstream out("Result.txt")
y
Scalar * y
Definition: level1_cplx_impl.h:124
GeographicLib::PolarStereographic
Polar stereographic projection.
Definition: PolarStereographic.hpp:36
std
Definition: BFloat16.h:88
args
Definition: pytypes.h:2210
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:25:01