GeographicLib 2.5
|
Conversions between auxiliary latitudes. More...
#include <GeographicLib/AuxLatitude.hpp>
Public Types | |
enum | aux { GEOGRAPHIC , PARAMETRIC , GEOCENTRIC , RECTIFYING , CONFORMAL , AUTHALIC , AUXNUMBER , PHI , BETA , THETA , MU , CHI , XI , COMMON , GEODETIC , REDUCED } |
Public Member Functions | |
AuxLatitude (real a, real f) | |
AuxAngle | Convert (int auxin, int auxout, const AuxAngle &zeta, bool exact=false) const |
Math::real | Convert (int auxin, int auxout, real zeta, bool exact=false) const |
AuxAngle | ToAuxiliary (int auxout, const AuxAngle &phi, real *diff=nullptr) const |
AuxAngle | FromAuxiliary (int auxin, const AuxAngle &zeta, int *niter=nullptr) const |
Math::real | RectifyingRadius (bool exact=false) const |
Math::real | AuthalicRadiusSquared (bool exact=false) const |
Math::real | EquatorialRadius () const |
Math::real | PolarSemiAxis () const |
Math::real | Flattening () const |
Static Public Member Functions | |
static AuxLatitude | axes (real a, real b) |
static Math::real | Clenshaw (bool sinp, real szeta, real czeta, const real c[], int K) |
static const AuxLatitude & | WGS84 () |
Static Public Attributes | |
static const int | Lmax |
Protected Member Functions | |
AuxAngle | Parametric (const AuxAngle &phi, real *diff=nullptr) const |
AuxAngle | Geocentric (const AuxAngle &phi, real *diff=nullptr) const |
AuxAngle | Rectifying (const AuxAngle &phi, real *diff=nullptr) const |
AuxAngle | Conformal (const AuxAngle &phi, real *diff=nullptr) const |
AuxAngle | Authalic (const AuxAngle &phi, real *diff=nullptr) const |
Conversions between auxiliary latitudes.
This class is an implementation of the methods described in
The provides accurate conversions between geographic (phi, φ), parametric (beta, β), geocentric (theta, θ), rectifying (mu, μ), conformal (chi, χ), and authalic (xi, ξ) latitudes for an ellipsoid of revolution. A latitude is represented by the class AuxAngle in order to maintain precision close to the poles.
The class implements two methods for the conversion:
The series method is the preferred method of conversion for any conversion involving μ, χ, or ξ, with abs(f) ≤ 1/150. The equations for the conversions between φ, β, and θ are sufficiently simple that the exact method should be used for such conversions and also for conversions with with abs(f) > 1/150.
Example of use:
Definition at line 75 of file AuxLatitude.hpp.
The floating-point type for real numbers. This just connects to the template parameters for the class. The different auxiliary latitudes.
Definition at line 86 of file AuxLatitude.hpp.
GeographicLib::AuxLatitude::AuxLatitude | ( | real | a, |
real | f | ||
) |
Constructor
[in] | a | equatorial radius. |
[in] | f | flattening of ellipsoid. Setting f = 0 gives a sphere. Negative f gives a prolate ellipsoid. |
GeographicErr | if a or (1 − f) a is not positive. |
Definition at line 25 of file AuxLatitude.cpp.
|
inlinestatic |
Construct and return an AuxLatitude object specified in terms of the semi-axes
[in] | a | equatorial radius. |
[in] | b | polar semi-axis. |
GeographicErr | if a or b is not positive. |
This allows a new AuxAngle to be initialized as an angle in radians with
Definition at line 195 of file AuxLatitude.hpp.
AuxAngle GeographicLib::AuxLatitude::Convert | ( | int | auxin, |
int | auxout, | ||
const AuxAngle & | zeta, | ||
bool | exact = false |
||
) | const |
Convert between any two auxiliary latitudes specified as AuxAngle.
[in] | auxin | an AuxLatitude::aux indicating the type of auxiliary latitude zeta. |
[in] | auxout | an AuxLatitude::aux indicating the type of auxiliary latitude eta. |
[in] | zeta | the input auxiliary latitude as an AuxAngle |
[in] | exact | if true use the exact equations instead of the Taylor series [default false]. |
With exact = false, the Fourier coefficients for a specific auxin and auxout are computed and saved on the first call; the saved coefficients are used on subsequent calls. The series method is accurate for abs(f) ≤ 1/150; for other f, the exact method should be used.
Definition at line 297 of file AuxLatitude.cpp.
References Clenshaw(), FromAuxiliary(), Lmax, GeographicLib::AuxAngle::NaN(), GeographicLib::AuxAngle::normalized(), GeographicLib::AuxAngle::radians(), ToAuxiliary(), GeographicLib::AuxAngle::x(), and GeographicLib::AuxAngle::y().
Referenced by Convert(), GeographicLib::Rhumb::GenInverse(), GeographicLib::RhumbLine::GenPosition(), and main().
Math::real GeographicLib::AuxLatitude::Convert | ( | int | auxin, |
int | auxout, | ||
real | zeta, | ||
bool | exact = false |
||
) | const |
Convert between any two auxiliary latitudes specified in degrees.
[in] | auxin | an AuxLatitude::aux indicating the type of auxiliary latitude zeta. |
[in] | auxout | an AuxLatitude::aux indicating the type of auxiliary latitude eta. |
[in] | zeta | the input auxiliary latitude in degrees. |
[in] | exact | if true use the exact equations instead of the Taylor series [default false]. |
With exact = false, the Fourier coefficients for a specific auxin and auxout are computed and saved on the first call; the saved coefficients are used on subsequent calls. The series method is accurate for abs(f) ≤ 1/150; for other f, the exact method should be used.
Definition at line 318 of file AuxLatitude.cpp.
References Convert(), GeographicLib::AuxAngle::degrees(), and GeographicLib::Math::td.
AuxAngle GeographicLib::AuxLatitude::ToAuxiliary | ( | int | auxout, |
const AuxAngle & | phi, | ||
real * | diff = nullptr |
||
) | const |
Convert geographic latitude to an auxiliary latitude eta.
[in] | auxout | an AuxLatitude::aux indicating the auxiliary latitude returned. |
[in] | phi | the geographic latitude. |
[out] | diff | optional pointer to the derivative d tan(eta) / d tan(phi). |
This uses the exact equations.
Definition at line 220 of file AuxLatitude.cpp.
References AUTHALIC, Authalic(), CONFORMAL, Conformal(), GEOCENTRIC, GEOGRAPHIC, GeographicLib::AuxAngle::NaN(), PARAMETRIC, Parametric(), RECTIFYING, and Rectifying().
Referenced by Convert(), and FromAuxiliary().
AuxAngle GeographicLib::AuxLatitude::FromAuxiliary | ( | int | auxin, |
const AuxAngle & | zeta, | ||
int * | niter = nullptr |
||
) | const |
Convert an auxiliary latitude zeta to geographic latitude.
[in] | auxin | an AuxLatitude::aux indicating the type of auxiliary latitude zeta. |
[in] | zeta | the input auxiliary latitude. |
[out] | niter | optional pointer to the number of iterations. |
This uses the exact equations.
Definition at line 236 of file AuxLatitude.cpp.
References AUTHALIC, CONFORMAL, GeographicLib::AuxAngle::copyquadrant(), GEOCENTRIC, GEOGRAPHIC, GeographicLib::AuxAngle::NaN(), PARAMETRIC, RECTIFYING, GeographicLib::AuxAngle::tan(), ToAuxiliary(), GeographicLib::AuxAngle::x(), and GeographicLib::AuxAngle::y().
Referenced by Convert().
Math::real GeographicLib::AuxLatitude::RectifyingRadius | ( | bool | exact = false | ) | const |
Return the rectifying radius.
[in] | exact | if true use the exact expression instead of the Taylor series [default false]. |
Definition at line 325 of file AuxLatitude.cpp.
References Lmax, GeographicLib::Math::pi(), GeographicLib::Math::polyval(), GeographicLib::EllipticFunction::RG(), and GeographicLib::Math::sq().
Referenced by GeographicLib::DAuxLatitude::DRectifying().
Math::real GeographicLib::AuxLatitude::AuthalicRadiusSquared | ( | bool | exact = false | ) | const |
Return the authalic radius squared.
[in] | exact | if true use the exact expression instead of the Taylor series [default false]. |
Definition at line 352 of file AuxLatitude.cpp.
References Lmax, GeographicLib::Math::polyval(), and GeographicLib::Math::sq().
Referenced by main().
|
inline |
Definition at line 284 of file AuxLatitude.hpp.
|
inline |
Definition at line 288 of file AuxLatitude.hpp.
|
inline |
Definition at line 292 of file AuxLatitude.hpp.
|
static |
Use Clenshaw to sum a Fouier series.
[in] | sinp | if true sum the sine series, else sum the cosine series. |
[in] | szeta | sin(zeta). |
[in] | czeta | cos(zeta). |
[in] | c | the array of coefficients. |
[in] | K | the number of coefficients. |
The result returned is \( \sum_0^{K-1} c_k \sin (2k+2)\zeta \), if sinp is true; with sinp false, replace sin by cos.
Referenced by Convert().
|
static |
A global instantiation of Ellipsoid with the parameters for the WGS84 ellipsoid.
Definition at line 79 of file AuxLatitude.cpp.
References GeographicLib::Constants::WGS84_a(), and GeographicLib::Constants::WGS84_f().
|
protected |
Convert geographic latitude to parametric latitude
[in] | phi | geographic latitude. |
[out] | diff | optional pointer to the derivative d tan(beta) / d tan(phi). |
Definition at line 84 of file AuxLatitude.cpp.
References GeographicLib::AuxAngle::x(), and GeographicLib::AuxAngle::y().
Referenced by Authalic(), Conformal(), GeographicLib::DAuxLatitude::DRectifying(), Rectifying(), and ToAuxiliary().
|
protected |
Convert geographic latitude to geocentric latitude
[in] | phi | geographic latitude. |
[out] | diff | optional pointer to the derivative d tan(theta) / d tan(phi). |
Definition at line 89 of file AuxLatitude.cpp.
References GeographicLib::AuxAngle::x(), and GeographicLib::AuxAngle::y().
|
protected |
Convert geographic latitude to rectifying latitude
[in] | phi | geographic latitude. |
[out] | diff | optional pointer to the derivative d tan(mu) / d tan(phi). |
Definition at line 94 of file AuxLatitude.cpp.
References GeographicLib::AuxAngle::normalized(), Parametric(), GeographicLib::Math::pi(), GeographicLib::EllipticFunction::RD(), GeographicLib::EllipticFunction::RF(), GeographicLib::Math::sq(), GeographicLib::AuxAngle::tan(), GeographicLib::AuxAngle::x(), and GeographicLib::AuxAngle::y().
Referenced by GeographicLib::DAuxLatitude::DRectifying(), and ToAuxiliary().
|
protected |
Convert geographic latitude to conformal latitude
[in] | phi | geographic latitude. |
[out] | diff | optional pointer to the derivative d tan(chi) / d tan(phi). |
Definition at line 140 of file AuxLatitude.cpp.
References GeographicLib::AuxAngle::normalized(), Parametric(), GeographicLib::AuxAngle::tan(), and GeographicLib::AuxAngle::x().
Referenced by ToAuxiliary().
|
protected |
Convert geographic latitude to authalic latitude
[in] | phi | geographic latitude. |
[out] | diff | optional pointer to the derivative d tan(xi) / d tan(phi). |
Definition at line 198 of file AuxLatitude.cpp.
References GeographicLib::AuxAngle::normalized(), Parametric(), GeographicLib::Math::sq(), GeographicLib::AuxAngle::tan(), GeographicLib::AuxAngle::x(), and GeographicLib::AuxAngle::y().
Referenced by ToAuxiliary().
|
static |
The order of the series expansions. This is set at compile time to either 4, 6, or 8, by the preprocessor macro GEOGRAPHICLIB_AUXLATITUDE_ORDER.
Definition at line 316 of file AuxLatitude.hpp.
Referenced by AuthalicRadiusSquared(), AuxLatitude(), Convert(), GeographicLib::DAuxLatitude::DConvert(), and RectifyingRadius().