Public Member Functions | Static Public Member Functions | Private Types | Private Attributes | List of all members
GeographicLib::PolarStereographic Class Reference

Polar stereographic projection. More...

#include <PolarStereographic.hpp>

Public Member Functions

void Forward (bool northp, real lat, real lon, real &x, real &y, real &gamma, real &k) const
 
void Forward (bool northp, real lat, real lon, real &x, real &y) const
 
 PolarStereographic (real a, real f, real k0)
 
void Reverse (bool northp, real x, real y, real &lat, real &lon, real &gamma, real &k) const
 
void Reverse (bool northp, real x, real y, real &lat, real &lon) const
 
void SetScale (real lat, real k=real(1))
 
Inspector functions
Math::real MajorRadius () const
 
Math::real Flattening () const
 
Math::real CentralScale () const
 

Static Public Member Functions

static const PolarStereographicUPS ()
 

Private Types

typedef Math::real real
 

Private Attributes

real _a
 
real _c
 
real _e2
 
real _e2m
 
real _es
 
real _f
 
real _k0
 

Detailed Description

Polar stereographic projection.

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.

This class also returns the meridian convergence gamma and scale k. The meridian convergence is the bearing of grid north (the y axis) measured clockwise from true north.

Example of use:

// Example of using the GeographicLib::PolarStereographic class
#include <iostream>
#include <iomanip>
#include <exception>
using namespace std;
using namespace GeographicLib;
int main() {
try {
// 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;
}
}

Definition at line 36 of file PolarStereographic.hpp.

Member Typedef Documentation

Definition at line 38 of file PolarStereographic.hpp.

Constructor & Destructor Documentation

GeographicLib::PolarStereographic::PolarStereographic ( real  a,
real  f,
real  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 16 of file src/PolarStereographic.cpp.

Member Function Documentation

Math::real GeographicLib::PolarStereographic::CentralScale ( ) const
inline

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 141 of file PolarStereographic.hpp.

Math::real GeographicLib::PolarStereographic::Flattening ( ) const
inline
Returns
f the flattening of the ellipsoid. This is the value used in the constructor.

Definition at line 134 of file PolarStereographic.hpp.

void GeographicLib::PolarStereographic::Forward ( bool  northp,
real  lat,
real  lon,
real x,
real y,
real gamma,
real k 
) const

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 61 of file src/PolarStereographic.cpp.

void GeographicLib::PolarStereographic::Forward ( bool  northp,
real  lat,
real  lon,
real x,
real y 
) const
inline

PolarStereographic::Forward without returning the convergence and scale.

Definition at line 106 of file PolarStereographic.hpp.

Math::real GeographicLib::PolarStereographic::MajorRadius ( ) const
inline
Returns
a the equatorial radius of the ellipsoid (meters). This is the value used in the constructor.

Definition at line 128 of file PolarStereographic.hpp.

void GeographicLib::PolarStereographic::Reverse ( bool  northp,
real  x,
real  y,
real lat,
real lon,
real gamma,
real k 
) const

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 81 of file src/PolarStereographic.cpp.

void GeographicLib::PolarStereographic::Reverse ( bool  northp,
real  x,
real  y,
real lat,
real lon 
) const
inline

PolarStereographic::Reverse without returning the convergence and scale.

Definition at line 115 of file PolarStereographic.hpp.

void GeographicLib::PolarStereographic::SetScale ( real  lat,
real  k = real(1) 
)

Set the scale for the projection.

Parameters
[in]lat(degrees) assuming northp = true.
[in]kscale at latitude lat (default 1).
Exceptions
GeographicErrk is not positive.
GeographicErrif lat is not in (−90°, 90°].

Definition at line 98 of file src/PolarStereographic.cpp.

const PolarStereographic & GeographicLib::PolarStereographic::UPS ( )
static

A global instantiation of PolarStereographic with the WGS84 ellipsoid and the UPS scale factor. However, unlike UPS, no false easting or northing is added.

Definition at line 33 of file src/PolarStereographic.cpp.

Member Data Documentation

real GeographicLib::PolarStereographic::_a
private

Definition at line 39 of file PolarStereographic.hpp.

real GeographicLib::PolarStereographic::_c
private

Definition at line 39 of file PolarStereographic.hpp.

real GeographicLib::PolarStereographic::_e2
private

Definition at line 39 of file PolarStereographic.hpp.

real GeographicLib::PolarStereographic::_e2m
private

Definition at line 39 of file PolarStereographic.hpp.

real GeographicLib::PolarStereographic::_es
private

Definition at line 39 of file PolarStereographic.hpp.

real GeographicLib::PolarStereographic::_f
private

Definition at line 39 of file PolarStereographic.hpp.

real GeographicLib::PolarStereographic::_k0
private

Definition at line 40 of file PolarStereographic.hpp.


The documentation for this class was generated from the following files:


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:58:00