GeographicLib::Math Class Reference

Mathematical functions needed by GeographicLib. More...

#include <GeographicLib/Constants.hpp>

List of all members.

Public Types

typedef double real

Static Public Member Functions

static real hypot (real x, real y) throw ()
static real expm1 (real x) throw ()
static real log1p (real x) throw ()
static real asinh (real x) throw ()
static real atanh (real x) throw ()
static real cbrt (real x) throw ()
static bool isfinite (real x) throw ()

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.

Definition at line 66 of file Constants.hpp.


Member Typedef Documentation

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).

Definition at line 81 of file Constants.hpp.


Member Function Documentation

static real GeographicLib::Math::hypot ( real  x,
real  y 
) throw () [inline, static]
static real GeographicLib::Math::expm1 ( real  x  )  throw () [inline, static]

Return exp(x) - 1 accurate near x = 0. This is taken from N. J. Higham, Accuracy and Stability of Numerical Algorithms, 2nd Edition (SIAM, 2002), Sec 1.14.1, p 19.

Definition at line 126 of file Constants.hpp.

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

static real GeographicLib::Math::log1p ( real  x  )  throw () [inline, static]

Return log(x + 1) accurate near x = 0. This is taken See D. Goldberg, What every computer scientist should know about floating-point arithmetic (1991), Theorem 4. See also, Higham (op. cit.), Answer to Problem 1.5, p 528.

Definition at line 154 of file Constants.hpp.

Referenced by asinh(), atanh(), and GeographicLib::LambertConformalConic::Reverse().

static real GeographicLib::Math::asinh ( real  x  )  throw () [inline, static]

Return asinh(x). This is defined in terms of Math::log1p(x) in order to maintain accuracy near x = 0. In addition, the odd parity of the function is enforced.

Definition at line 179 of file Constants.hpp.

References hypot(), and log1p().

Referenced by GeographicLib::TransverseMercator::Forward().

static real GeographicLib::Math::atanh ( real  x  )  throw () [inline, static]

Return atanh(x). This is defined in terms of Math::log1p(x) in order to maintain accuracy near x = 0. In addition, the odd parity of the function is enforced.

Definition at line 199 of file Constants.hpp.

References log1p().

static real GeographicLib::Math::cbrt ( real  x  )  throw () [inline, static]

Return the real cube root of x.

Definition at line 217 of file Constants.hpp.

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

static bool GeographicLib::Math::isfinite ( real  x  )  throw () [inline, static]

Return true if number is finite, false if NaN or infinite.

Definition at line 232 of file Constants.hpp.


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

Generated on 21 May 2010 for GeographicLib by  doxygen 1.6.1