GeographicLib  1.48
Public Types | Static Public Member Functions | Static Public Attributes | List of all members
GeographicLib::Math Class Reference

Mathematical functions needed by GeographicLib. More...

#include <GeographicLib/Math.hpp>

Public Types

typedef double extended
 
typedef double real
 

Static Public Member Functions

static int digits ()
 
static int set_digits (int ndigits)
 
static int digits10 ()
 
static int extra_digits ()
 
template<typename T >
static T pi ()
 
static real pi ()
 
template<typename T >
static T degree ()
 
static real degree ()
 
template<typename T >
static T sq (T x)
 
template<typename T >
static T hypot (T x, T y)
 
template<typename T >
static T expm1 (T x)
 
template<typename T >
static T log1p (T x)
 
template<typename T >
static T asinh (T x)
 
template<typename T >
static T atanh (T x)
 
template<typename T >
static T cbrt (T x)
 
template<typename T >
static T fma (T x, T y, T z)
 
template<typename T >
static void norm (T &x, T &y)
 
template<typename T >
static T sum (T u, T v, T &t)
 
template<typename T >
static T polyval (int N, const T p[], T x)
 
template<typename T >
static T AngNormalize (T x)
 
template<typename T >
static T LatFix (T x)
 
template<typename T >
static T AngDiff (T x, T y, T &e)
 
template<typename T >
static T AngDiff (T x, T y)
 
template<typename T >
static T AngRound (T x)
 
template<typename T >
static void sincosd (T x, T &sinx, T &cosx)
 
template<typename T >
static T sind (T x)
 
template<typename T >
static T cosd (T x)
 
template<typename T >
static T tand (T x)
 
template<typename T >
static T atan2d (T y, T x)
 
template<typename T >
static T atand (T x)
 
template<typename T >
static T eatanhe (T x, T es)
 
template<typename T >
static T copysign (T x, T y)
 
template<typename T >
static T taupf (T tau, T es)
 
template<typename T >
static T tauf (T taup, T es)
 
template<typename T >
static bool isfinite (T x)
 
template<typename T >
static T NaN ()
 
static real NaN ()
 
template<typename T >
static bool isnan (T x)
 
template<typename T >
static T infinity ()
 
static real infinity ()
 
template<typename T >
static T swab (T x)
 

Static Public Attributes

static const bool bigendian = GEOGRAPHICLIB_WORDS_BIGENDIAN
 

Detailed Description

Mathematical functions needed by GeographicLib.

Define mathematical functions in order to localize system dependencies and to provide generic versions of the functions. In addition define a real type to be used by GeographicLib.

Example of use:

// Example of using the GeographicLib::Math class
#include <iostream>
#include <exception>
using namespace std;
using namespace GeographicLib;
int main() {
try {
cout << Math::pi() << " " << Math::sq(Math::pi()) << "\n";
}
catch (const exception& e) {
cerr << "Caught exception: " << e.what() << "\n";
return 1;
}
}

Definition at line 102 of file Math.hpp.

Member Typedef Documentation

◆ extended

Definition at line 119 of file Math.hpp.

◆ real

typedef double GeographicLib::Math::real

The real type for GeographicLib. Nearly all the testing has been done with real = double. However, the algorithms should also work with float and long double (where available). (CAUTION: reasonable accuracy typically cannot be obtained using floats.)

Definition at line 129 of file Math.hpp.

Member Function Documentation

◆ digits()

static int GeographicLib::Math::digits ( )
inlinestatic
Returns
the number of bits of precision in a real number.

Definition at line 145 of file Math.hpp.

Referenced by GeographicLib::MGRS::Forward(), and GeographicLib::MGRS::Reverse().

◆ set_digits()

static int GeographicLib::Math::set_digits ( int  ndigits)
inlinestatic

Set the binary precision of a real number.

Parameters
[in]ndigitsthe number of bits of precision.
Returns
the resulting number of bits of precision.

This only has an effect when GEOGRAPHICLIB_PRECISION = 5. See also Utility::set_digits for caveats about when this routine should be called.

Definition at line 163 of file Math.hpp.

Referenced by GeographicLib::Utility::set_digits().

◆ digits10()

static int GeographicLib::Math::digits10 ( )
inlinestatic
Returns
the number of decimal digits of precision in a real number.

Definition at line 175 of file Math.hpp.

◆ extra_digits()

static int GeographicLib::Math::extra_digits ( )
inlinestatic

Number of additional decimal digits of precision for real relative to double (0 for float).

Definition at line 187 of file Math.hpp.

Referenced by GeographicLib::GeoCoords::AltMGRSRepresentation(), GeographicLib::GeoCoords::DMSRepresentation(), GeographicLib::DMS::Encode(), GeographicLib::GeoCoords::GeoRepresentation(), and main().

◆ pi() [1/2]

template<typename T >
static T GeographicLib::Math::pi ( )
inlinestatic

◆ pi() [2/2]

static real GeographicLib::Math::pi ( )
inlinestatic

A synonym for pi<real>().

Definition at line 210 of file Math.hpp.

◆ degree() [1/2]

template<typename T >
static T GeographicLib::Math::degree ( )
inlinestatic

◆ degree() [2/2]

static real GeographicLib::Math::degree ( )
inlinestatic

A synonym for degree<real>().

Definition at line 223 of file Math.hpp.

◆ sq()

template<typename T >
static T GeographicLib::Math::sq ( x)
inlinestatic

Square a number.

Template Parameters
Tthe type of the argument and the returned value.
Parameters
[in]x
Returns
x2.

Definition at line 232 of file Math.hpp.

Referenced by GeographicLib::AlbersEqualArea::AlbersEqualArea(), GeographicLib::GeodesicExact::ArcDirectLine(), GeographicLib::Geodesic::ArcDirectLine(), GeographicLib::Ellipsoid::Area(), GeographicLib::AlbersEqualArea::AzimuthalEqualAreaSouth(), GeographicLib::MagneticModel::FieldComponents(), GeographicLib::NormalGravity::FlatteningToJ2(), GeographicLib::Ellipsoid::FlatteningToSecondEccentricitySq(), GeographicLib::Ellipsoid::FlatteningToThirdEccentricitySq(), GeographicLib::PolarStereographic::Forward(), GeographicLib::TransverseMercator::Forward(), GeographicLib::AlbersEqualArea::Forward(), GeographicLib::LambertConformalConic::Forward(), GeographicLib::GeodesicLineExact::GenPosition(), GeographicLib::GeodesicLine::GenPosition(), GeographicLib::GravityModel::GravityModel(), GeographicLib::NormalGravity::GRS80(), GeographicLib::GeodesicExact::InverseLine(), GeographicLib::Geodesic::InverseLine(), GeographicLib::NormalGravity::J2ToFlattening(), GeographicLib::LambertConformalConic::LambertConformalConic(), GeographicLib::Ellipsoid::MeridionalCurvatureRadius(), GeographicLib::Ellipsoid::NormalCurvatureRadius(), GeographicLib::NormalGravity::Phi(), GeographicLib::EllipticFunction::Reset(), GeographicLib::PolarStereographic::Reverse(), GeographicLib::TransverseMercator::Reverse(), GeographicLib::AlbersEqualArea::Reverse(), GeographicLib::LambertConformalConic::Reverse(), GeographicLib::EllipticFunction::RG(), GeographicLib::EllipticFunction::RJ(), GeographicLib::AlbersEqualArea::SetScale(), GeographicLib::NormalGravity::SurfaceGravity(), GeographicLib::Ellipsoid::TransverseCurvatureRadius(), GeographicLib::TransverseMercatorExact::UTM(), GeographicLib::NormalGravity::V0(), GeographicLib::Ellipsoid::Volume(), GeographicLib::Geocentric::WGS84(), GeographicLib::JacobiConformal::x(), and GeographicLib::JacobiConformal::y().

◆ hypot()

template<typename T >
static T GeographicLib::Math::hypot ( x,
y 
)
inlinestatic

◆ expm1()

template<typename T >
static T GeographicLib::Math::expm1 ( x)
inlinestatic

exp(x) − 1 accurate near x = 0.

Template Parameters
Tthe type of the argument and the returned value.
Parameters
[in]x
Returns
exp(x) − 1.

Definition at line 265 of file Math.hpp.

References GEOGRAPHICLIB_VOLATILE.

Referenced by GeographicLib::LambertConformalConic::LambertConformalConic().

◆ log1p()

template<typename T >
static T GeographicLib::Math::log1p ( x)
inlinestatic

log(1 + x) accurate near x = 0.

Template Parameters
Tthe type of the argument and the returned value.
Parameters
[in]x
Returns
log(1 + x).

Definition at line 288 of file Math.hpp.

References GEOGRAPHICLIB_VOLATILE.

Referenced by GeographicLib::LambertConformalConic::Reverse().

◆ asinh()

template<typename T >
static T GeographicLib::Math::asinh ( x)
inlinestatic

The inverse hyperbolic sine function.

Template Parameters
Tthe type of the argument and the returned value.
Parameters
[in]x
Returns
asinh(x).

Definition at line 311 of file Math.hpp.

Referenced by GeographicLib::TransverseMercator::Forward(), GeographicLib::LambertConformalConic::Forward(), GeographicLib::Ellipsoid::IsometricLatitude(), GeographicLib::LambertConformalConic::LambertConformalConic(), GeographicLib::EllipticFunction::RC(), and GeographicLib::TransverseMercatorExact::UTM().

◆ atanh()

template<typename T >
static T GeographicLib::Math::atanh ( x)
inlinestatic

The inverse hyperbolic tangent function.

Template Parameters
Tthe type of the argument and the returned value.
Parameters
[in]x
Returns
atanh(x).

Definition at line 328 of file Math.hpp.

Referenced by GeographicLib::Ellipsoid::Area(), and GeographicLib::AlbersEqualArea::AzimuthalEqualAreaSouth().

◆ cbrt()

template<typename T >
static T GeographicLib::Math::cbrt ( x)
inlinestatic

The cube root function.

Template Parameters
Tthe type of the argument and the returned value.
Parameters
[in]x
Returns
the real cube root of x.

Definition at line 345 of file Math.hpp.

Referenced by GeographicLib::GeodesicExact::InverseLine(), GeographicLib::Geodesic::InverseLine(), GeographicLib::TransverseMercatorExact::UTM(), and GeographicLib::Geocentric::WGS84().

◆ fma()

template<typename T >
static T GeographicLib::Math::fma ( x,
y,
z 
)
inlinestatic

Fused multiply and add.

Template Parameters
Tthe type of the arguments and the returned value.
Parameters
[in]x
[in]y
[in]z
Returns
xy + z, correctly rounded (on those platforms with support for the fma instruction).

On platforms without the fma instruction, no attempt is made to improve on the result of a rounded multiplication followed by a rounded addition.

Definition at line 369 of file Math.hpp.

Referenced by GeographicLib::Accumulator< T >::operator*=().

◆ norm()

template<typename T >
static void GeographicLib::Math::norm ( T &  x,
T &  y 
)
inlinestatic

Normalize a two-vector.

Template Parameters
Tthe type of the argument and the returned value.
Parameters
[in,out]xon output set to x/hypot(x, y).
[in,out]yon output set to y/hypot(x, y).

Definition at line 384 of file Math.hpp.

Referenced by GeographicLib::GeodesicExact::ArcDirectLine(), GeographicLib::Geodesic::ArcDirectLine(), GeographicLib::GeodesicExact::InverseLine(), GeographicLib::Geodesic::InverseLine(), and GeographicLib::CassiniSoldner::Reset().

◆ sum()

template<typename T >
static T GeographicLib::Math::sum ( u,
v,
T &  t 
)
inlinestatic

The error-free sum of two numbers.

Template Parameters
Tthe type of the argument and the returned value.
Parameters
[in]u
[in]v
[out]tthe exact error given by (u + v) - s.
Returns
s = round(u + v).

See D. E. Knuth, TAOCP, Vol 2, 4.2.2, Theorem B. (Note that t can be the same as one of the first two arguments.)

Definition at line 399 of file Math.hpp.

References GEOGRAPHICLIB_VOLATILE.

◆ polyval()

template<typename T >
static T GeographicLib::Math::polyval ( int  N,
const T  p[],
x 
)
inlinestatic

Evaluate a polynomial.

Template Parameters
Tthe type of the arguments and returned value.
Parameters
[in]Nthe order of the polynomial.
[in]pthe coefficient array (of size N + 1).
[in]xthe variable.
Returns
the value of the polynomial.

Evaluate y = ∑n=0..N pn xNn. Return 0 if N < 0. Return p0, if N = 0 (even if x is infinite or a nan). The evaluation uses Horner's method.

Definition at line 425 of file Math.hpp.

Referenced by GeographicLib::GeodesicExact::InverseLine(), and GeographicLib::Geodesic::InverseLine().

◆ AngNormalize()

template<typename T >
static T GeographicLib::Math::AngNormalize ( x)
inlinestatic

◆ LatFix()

template<typename T >
static T GeographicLib::Math::LatFix ( x)
inlinestatic

Normalize a latitude.

Template Parameters
Tthe type of the argument and returned value.
Parameters
[in]xthe angle in degrees.
Returns
x if it is in the range [−90°, 90°], otherwise return NaN.

Definition at line 464 of file Math.hpp.

Referenced by GeographicLib::PolygonAreaT< GeodType >::AddPoint(), GeographicLib::GeodesicExact::ArcDirectLine(), GeographicLib::Geodesic::ArcDirectLine(), GeographicLib::Ellipsoid::AuthalicLatitude(), GeographicLib::Geoid::CacheArea(), GeographicLib::Ellipsoid::CircleHeight(), GeographicLib::Ellipsoid::CircleRadius(), GeographicLib::Ellipsoid::ConformalLatitude(), GeographicLib::PolarStereographic::Forward(), GeographicLib::TransverseMercator::Forward(), GeographicLib::TransverseMercatorExact::Forward(), GeographicLib::AlbersEqualArea::Forward(), GeographicLib::LambertConformalConic::Forward(), GeographicLib::Rhumb::GenDirect(), GeographicLib::Ellipsoid::GeocentricLatitude(), GeographicLib::Ellipsoid::InverseAuthalicLatitude(), GeographicLib::Ellipsoid::InverseConformalLatitude(), GeographicLib::Ellipsoid::InverseGeocentricLatitude(), GeographicLib::Ellipsoid::InverseParametricLatitude(), GeographicLib::Ellipsoid::IsometricLatitude(), GeographicLib::Ellipsoid::MeridionalCurvatureRadius(), GeographicLib::Ellipsoid::NormalCurvatureRadius(), GeographicLib::Ellipsoid::ParametricLatitude(), GeographicLib::LocalCartesian::Reset(), GeographicLib::NormalGravity::SurfaceGravity(), GeographicLib::Ellipsoid::TransverseCurvatureRadius(), and GeographicLib::Geocentric::WGS84().

◆ AngDiff() [1/2]

template<typename T >
static T GeographicLib::Math::AngDiff ( x,
y,
T &  e 
)
inlinestatic

The exact difference of two angles reduced to (−180°, 180°].

Template Parameters
Tthe type of the arguments and returned value.
Parameters
[in]xthe first angle in degrees.
[in]ythe second angle in degrees.
[out]ethe error term in degrees.
Returns
d, the truncated value of yx.

This computes z = yx exactly, reduced to (−180°, 180°]; and then sets z = d + e where d is the nearest representable number to z and e is the truncation error. If d = −180, then e > 0; If d = 180, then e ≤ 0.

Definition at line 483 of file Math.hpp.

Referenced by GeographicLib::GeodesicExact::ArcDirectLine(), GeographicLib::Geodesic::ArcDirectLine(), GeographicLib::TransverseMercator::Forward(), GeographicLib::CassiniSoldner::Forward(), GeographicLib::TransverseMercatorExact::Forward(), GeographicLib::AlbersEqualArea::Forward(), GeographicLib::LambertConformalConic::Forward(), GeographicLib::Rhumb::GenInverse(), and main().

◆ AngDiff() [2/2]

template<typename T >
static T GeographicLib::Math::AngDiff ( x,
y 
)
inlinestatic

Difference of two angles reduced to [−180°, 180°]

Template Parameters
Tthe type of the arguments and returned value.
Parameters
[in]xthe first angle in degrees.
[in]ythe second angle in degrees.
Returns
yx, reduced to the range [−180°, 180°].

The result is equivalent to computing the difference exactly, reducing it to (−180°, 180°] and rounding the result. Note that this prescription allows −180° to be returned (e.g., if x is tiny and negative and y = 180°).

Definition at line 514 of file Math.hpp.

◆ AngRound()

template<typename T >
static T GeographicLib::Math::AngRound ( x)
inlinestatic

Coarsen a value close to zero.

Template Parameters
Tthe type of the argument and returned value.
Parameters
[in]x
Returns
the coarsened value.

The makes the smallest gap in x = 1/16 - nextafter(1/16, 0) = 1/257 for reals = 0.7 pm on the earth if x is an angle in degrees. (This is about 1000 times more resolution than we get with angles around 90°.) We use this to avoid having to deal with near singular cases when x is non-zero but tiny (e.g., 10−200). This converts -0 to +0; however tiny negative numbers get converted to -0.

Definition at line 532 of file Math.hpp.

References GEOGRAPHICLIB_VOLATILE.

Referenced by GeographicLib::GeodesicExact::ArcDirectLine(), GeographicLib::Geodesic::ArcDirectLine(), GeographicLib::GeodesicExact::GenDirectLine(), GeographicLib::Geodesic::GenDirectLine(), GeographicLib::GeodesicLine::GeodesicLine(), and GeographicLib::GeodesicLineExact::GeodesicLineExact().

◆ sincosd()

template<typename T >
static void GeographicLib::Math::sincosd ( x,
T &  sinx,
T &  cosx 
)
inlinestatic

Evaluate the sine and cosine function with the argument in degrees

Template Parameters
Tthe type of the arguments.
Parameters
[in]xin degrees.
[out]sinxsin(x).
[out]cosxcos(x).

The results obey exactly the elementary properties of the trigonometric functions, e.g., sin 9° = cos 81° = − sin 123456789°. If x = −0, then sinx = −0; this is the only case where −0 is returned.

Definition at line 555 of file Math.hpp.

Referenced by GeographicLib::AlbersEqualArea::AlbersEqualArea(), GeographicLib::GeodesicExact::ArcDirectLine(), GeographicLib::Geodesic::ArcDirectLine(), GeographicLib::GravityCircle::Disturbance(), GeographicLib::EllipticFunction::Ed(), GeographicLib::AzimuthalEquidistant::Forward(), GeographicLib::PolarStereographic::Forward(), GeographicLib::TransverseMercator::Forward(), GeographicLib::CassiniSoldner::Forward(), GeographicLib::Gnomonic::Forward(), GeographicLib::AlbersEqualArea::Forward(), GeographicLib::LambertConformalConic::Forward(), GeographicLib::GeodesicExact::GenDirectLine(), GeographicLib::Geodesic::GenDirectLine(), GeographicLib::GeodesicLine::GenPosition(), GeographicLib::GeodesicLine::GeodesicLine(), GeographicLib::GeodesicLineExact::GeodesicLineExact(), GeographicLib::GravityCircle::GeoidHeight(), GeographicLib::GravityCircle::Gravity(), GeographicLib::LambertConformalConic::LambertConformalConic(), GeographicLib::Ellipsoid::NormalCurvatureRadius(), GeographicLib::CircularEngine::operator()(), GeographicLib::LocalCartesian::Reset(), GeographicLib::CassiniSoldner::Reset(), GeographicLib::GravityCircle::SphericalAnomaly(), GeographicLib::GravityCircle::T(), GeographicLib::GravityCircle::V(), GeographicLib::GravityCircle::W(), GeographicLib::Geocentric::WGS84(), GeographicLib::JacobiConformal::x(), and GeographicLib::JacobiConformal::y().

◆ sind()

template<typename T >
static T GeographicLib::Math::sind ( x)
inlinestatic

Evaluate the sine function with the argument in degrees

Template Parameters
Tthe type of the argument and the returned value.
Parameters
[in]xin degrees.
Returns
sin(x).

Definition at line 606 of file Math.hpp.

Referenced by GeographicLib::Ellipsoid::MeridionalCurvatureRadius(), GeographicLib::Ellipsoid::NormalCurvatureRadius(), GeographicLib::NormalGravity::SurfaceGravity(), and GeographicLib::Ellipsoid::TransverseCurvatureRadius().

◆ cosd()

template<typename T >
static T GeographicLib::Math::cosd ( x)
inlinestatic

Evaluate the cosine function with the argument in degrees

Template Parameters
Tthe type of the argument and the returned value.
Parameters
[in]xin degrees.
Returns
cos(x).

Definition at line 636 of file Math.hpp.

◆ tand()

template<typename T >
static T GeographicLib::Math::tand ( x)
inlinestatic

◆ atan2d()

template<typename T >
static T GeographicLib::Math::atan2d ( y,
x 
)
inlinestatic

◆ atand()

template<typename T >
static T GeographicLib::Math::atand ( x)
inlinestatic

◆ eatanhe()

template<typename T >
T GeographicLib::Math::eatanhe ( x,
es 
)
static

Evaluate e atanh(e x)

Template Parameters
Tthe type of the argument and the returned value.
Parameters
[in]x
[in]esthe signed eccentricity = sign(e2) sqrt(|e2|)
Returns
e atanh(e x)

If e2 is negative (e is imaginary), the expression is evaluated in terms of atan.

Definition at line 21 of file Math.cpp.

Referenced by GeographicLib::LambertConformalConic::Forward(), and GeographicLib::LambertConformalConic::LambertConformalConic().

◆ copysign()

template<typename T >
static T GeographicLib::Math::copysign ( x,
y 
)
inlinestatic

Copy the sign.

Template Parameters
Tthe type of the argument.
Parameters
[in]xgives the magitude of the result.
[in]ygives the sign of the result.
Returns
value with the magnitude of x and with the sign of y.

This routine correctly handles the case y = −0, returning &minus|x|.

Definition at line 748 of file Math.hpp.

Referenced by GeographicLib::EllipticFunction::D(), GeographicLib::EllipticFunction::E(), GeographicLib::EllipticFunction::F(), GeographicLib::EllipticFunction::G(), GeographicLib::GeodesicLineExact::GenPosition(), GeographicLib::GeodesicLine::GenPosition(), GeographicLib::EllipticFunction::H(), GeographicLib::EllipticFunction::Pi(), and GeographicLib::NormalGravity::V0().

◆ taupf()

template<typename T >
T GeographicLib::Math::taupf ( tau,
es 
)
static

tanχ in terms of tanφ

Template Parameters
Tthe type of the argument and the returned value.
Parameters
[in]tauτ = tanφ
[in]esthe signed eccentricity = sign(e2) sqrt(|e2|)
Returns
τ′ = tanχ

See Eqs. (7–9) of C. F. F. Karney, Transverse Mercator with an accuracy of a few nanometers, J. Geodesy 85(8), 475–485 (Aug. 2011) (preprint arXiv:1002.1417).

Definition at line 25 of file Math.cpp.

Referenced by GeographicLib::Ellipsoid::ConformalLatitude(), GeographicLib::PolarStereographic::Forward(), GeographicLib::TransverseMercator::Forward(), GeographicLib::TransverseMercatorExact::Forward(), GeographicLib::Rhumb::GenDirect(), and GeographicLib::Ellipsoid::IsometricLatitude().

◆ tauf()

template<typename T >
T GeographicLib::Math::tauf ( taup,
es 
)
static

tanφ in terms of tanχ

Template Parameters
Tthe type of the argument and the returned value.
Parameters
[in]taupτ′ = tanχ
[in]esthe signed eccentricity = sign(e2) sqrt(|e2|)
Returns
τ = tanφ

See Eqs. (19–21) of C. F. F. Karney, Transverse Mercator with an accuracy of a few nanometers, J. Geodesy 85(8), 475–485 (Aug. 2011) (preprint arXiv:1002.1417).

Definition at line 31 of file Math.cpp.

References GEOGRAPHICLIB_PANIC.

Referenced by GeographicLib::TransverseMercatorExact::Forward(), GeographicLib::Ellipsoid::InverseConformalLatitude(), GeographicLib::Ellipsoid::InverseIsometricLatitude(), GeographicLib::PolarStereographic::Reverse(), GeographicLib::TransverseMercator::Reverse(), GeographicLib::TransverseMercatorExact::Reverse(), and GeographicLib::LambertConformalConic::Reverse().

◆ isfinite()

template<typename T >
static bool GeographicLib::Math::isfinite ( x)
inlinestatic

◆ NaN() [1/2]

template<typename T >
static T GeographicLib::Math::NaN ( )
inlinestatic

The NaN (not a number)

Template Parameters
Tthe type of the returned value.
Returns
NaN if available, otherwise return the max real of type T.

Definition at line 825 of file Math.hpp.

Referenced by GeographicLib::NormalGravity::AngularVelocity(), GeographicLib::GeodesicLineExact::Azimuth(), GeographicLib::GeodesicLine::Azimuth(), GeographicLib::GravityModel::Circle(), GeographicLib::PolygonAreaT< GeodType >::Clear(), GeographicLib::NormalGravity::DynamicalFormFactor(), GeographicLib::GeodesicLineExact::EquatorialArc(), GeographicLib::GeodesicLine::EquatorialArc(), GeographicLib::GeodesicLineExact::EquatorialAzimuth(), GeographicLib::GeodesicLine::EquatorialAzimuth(), GeographicLib::NormalGravity::EquatorialGravity(), GeographicLib::MagneticCircle::Flattening(), GeographicLib::Geocentric::Flattening(), GeographicLib::GravityCircle::Flattening(), GeographicLib::NormalGravity::Flattening(), GeographicLib::GeodesicLineExact::Flattening(), GeographicLib::GeodesicLine::Flattening(), GeographicLib::Gnomonic::Forward(), GeographicLib::UTMUPS::Forward(), GeographicLib::GeodesicLineExact::GenDistance(), GeographicLib::GeodesicLine::GenDistance(), GeographicLib::GeodesicLineExact::GenPosition(), GeographicLib::GeodesicLine::GenPosition(), GeographicLib::RhumbLine::GenPosition(), GeographicLib::GravityCircle::GeoidHeight(), GeographicLib::NormalGravity::GravityFlattening(), GeographicLib::GravityModel::GravityModel(), GeographicLib::OSGB::GridReference(), GeographicLib::MagneticCircle::Height(), GeographicLib::GravityCircle::Height(), GeographicLib::NormalGravity::J2ToFlattening(), GeographicLib::MagneticCircle::Latitude(), GeographicLib::GravityCircle::Latitude(), GeographicLib::GeodesicLineExact::Latitude(), GeographicLib::GeodesicLine::Latitude(), GeographicLib::GeodesicLineExact::Longitude(), GeographicLib::GeodesicLine::Longitude(), main(), GeographicLib::MagneticCircle::MajorRadius(), GeographicLib::Geocentric::MajorRadius(), GeographicLib::GravityCircle::MajorRadius(), GeographicLib::NormalGravity::MajorRadius(), GeographicLib::GeodesicLineExact::MajorRadius(), GeographicLib::GeodesicLine::MajorRadius(), GeographicLib::NormalGravity::MassConstant(), GeographicLib::NormalGravity::PolarGravity(), GeographicLib::Geohash::Reverse(), GeographicLib::GARS::Reverse(), GeographicLib::Georef::Reverse(), GeographicLib::Gnomonic::Reverse(), GeographicLib::UTMUPS::Reverse(), GeographicLib::MGRS::Reverse(), GeographicLib::GeodesicLineExact::SetArc(), GeographicLib::GeodesicLine::SetArc(), GeographicLib::GravityCircle::SphericalAnomaly(), GeographicLib::NormalGravity::SurfacePotential(), GeographicLib::PolygonAreaT< GeodType >::TestEdge(), and GeographicLib::MagneticCircle::Time().

◆ NaN() [2/2]

static real GeographicLib::Math::NaN ( )
inlinestatic

A synonym for NaN<real>().

Definition at line 839 of file Math.hpp.

◆ isnan()

template<typename T >
static bool GeographicLib::Math::isnan ( x)
inlinestatic

◆ infinity() [1/2]

template<typename T >
static T GeographicLib::Math::infinity ( )
inlinestatic

Infinity

Template Parameters
Tthe type of the returned value.
Returns
infinity if available, otherwise return the max real.

Definition at line 862 of file Math.hpp.

Referenced by GeographicLib::EllipticFunction::Reset().

◆ infinity() [2/2]

static real GeographicLib::Math::infinity ( )
inlinestatic

A synonym for infinity<real>().

Definition at line 876 of file Math.hpp.

◆ swab()

template<typename T >
static T GeographicLib::Math::swab ( x)
inlinestatic

Swap the bytes of a quantity

Template Parameters
Tthe type of the argument and the returned value.
Parameters
[in]x
Returns
x with its bytes swapped.

Definition at line 885 of file Math.hpp.

References std::swap().

Member Data Documentation

◆ bigendian

const bool GeographicLib::Math::bigendian = GEOGRAPHICLIB_WORDS_BIGENDIAN
static

true if the machine is big-endian.

Definition at line 196 of file Math.hpp.

Referenced by GeographicLib::Utility::readarray(), and GeographicLib::Utility::writearray().


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