Loading...
Searching...
No Matches
GeographicLib::Constants Class Reference

Constants needed by GeographicLib More...

`#include <GeographicLib/Constants.hpp>`

## Static Public Member Functions

static Math::real | degree ()
static Math::real | arcminute ()
static Math::real | arcsecond ()
Ellipsoid parameters
template<typename T = real>
static T | WGS84_a ()
template<typename T = real>
static T | WGS84_f ()
template<typename T = real>
static T | WGS84_GM ()
template<typename T = real>
static T | WGS84_omega ()
template<typename T = real>
static T | GRS80_a ()
template<typename T = real>
static T | GRS80_GM ()
template<typename T = real>
static T | GRS80_omega ()
template<typename T = real>
static T | GRS80_J2 ()
template<typename T = real>
static T | UTM_k0 ()
template<typename T = real>
static T | UPS_k0 ()
Triaxial ellipsoid parameters

These parameters are close to the values given by Milan Bursa, Vladimira Fialova, "Parameters of the Earth's tri-axial level ellipsoid", Studia Geophysica et Geodaetica 37(1), 1-13 (1993).

- longitude of major axis = −14.93° ± 0.05°
- a = 6378171.36 m ± 0.30 m
- a / (a − c) = 297.7738 ± 0.0003
- a / (a − b) = 91449 ± 60

which gives: a = 6378171.36 m, b = 6378101.61 m, c = 6356751.84 m. Here take the semiaxes to be whole numbers of meters, with (a + b)/2 = WGS84_a(), a − b = 70 m, c = round(WGS84_a() * (1 - WGS84_f())). This gives

- a = 6378172 m
- b = 6378102 m
- c = 6356752 m
- lon0 = −14.93°

template<typename T = real>
static T | Triaxial_Earth_a ()
template<typename T = real>
static T | Triaxial_Earth_b ()
template<typename T = real>
static T | Triaxial_Earth_c ()
template<typename T = real>
static T | Triaxial_Earth_lon0 ()
SI units
template<typename T = real>
static T | meter ()
static Math::real | kilometer ()
static Math::real | nauticalmile ()
template<typename T = real>
static T | square_meter ()
static Math::real | hectare ()
static Math::real | square_kilometer ()
static Math::real | square_nauticalmile ()
Anachronistic British units
static Math::real | foot ()
static Math::real | yard ()
static Math::real | fathom ()
static Math::real | chain ()
static Math::real | furlong ()
static Math::real | mile ()
static Math::real | acre ()
static Math::real | square_mile ()
Anachronistic US units
static Math::real | surveyfoot ()

## Related Symbols

(Note that these are not member symbols.)
#define | GEOGRAPHICLIB_VERSION_NUM(a, b, c)
#define | GEOGRAPHICLIB_VERSION

## Detailed Description

Constants needed by GeographicLib

Define constants specifying the WGS84 ellipsoid, the UTM and UPS projections, and various unit conversions.

Example of use:

// Example of using the GeographicLib::Constants class
#include <iostream>
#include <exception>
#include <GeographicLib/Constants.hpp>
using namespace std;
using namespace GeographicLib;
int main() {
try {
cout << "WGS84 parameters:\n"
<< "a = " << Constants::WGS84_a() << " m\n"
<< "f = 1/" << 1/Constants::WGS84_f() << "\n";
}
catch (const exception& e) {
cerr << "Caught exception: " << e.what() << "\n";
return 1;
}
}
main
int main(int argc, const char *const argv[])
Definition Cart3Convert.cpp:52
Constants.hpp
Header for GeographicLib::Constants class.
GeographicLib::Constants::WGS84_f
static T WGS84_f()
Definition Constants.hpp:118
GeographicLib::Constants::WGS84_a
static T WGS84_a()
Definition Constants.hpp:112
GeographicLib
Namespace for GeographicLib.
Definition Accumulator.cpp:12
std
Definition NearestNeighbor.hpp:806

Definition at line 84 of file Constants.hpp.

## Member Function Documentation

## degree()

Math::real GeographicLib::Constants::degree | ( |  | ) |

inline static

A synonym for Math::degree<real>().

Definition at line 93 of file Constants.hpp.

References GeographicLib::Math::degree().

## arcminute()

Math::real GeographicLib::Constants::arcminute | ( |  | ) |

inline static

Returns
  the number of radians in an arcminute.

Definition at line 97 of file Constants.hpp.

References GeographicLib::Math::degree(), and GeographicLib::Math::dm.

## arcsecond()

Math::real GeographicLib::Constants::arcsecond | ( |  | ) |

inline static

Returns
  the number of radians in an arcsecond.

Definition at line 102 of file Constants.hpp.

References GeographicLib::Math::degree(), and GeographicLib::Math::ds.

## WGS84_a()

template<typename T = real>

T GeographicLib::Constants::WGS84_a | ( |  | ) |

inline static

Template Parameters

  T | the type of the returned value.

Returns
  the equatorial radius of WGS84 ellipsoid (6378137 m).

Definition at line 112 of file Constants.hpp.

References meter().

Referenced by GeographicLib::AlbersEqualArea::AzimuthalEqualAreaNorth(), GeographicLib::AlbersEqualArea::AzimuthalEqualAreaSouth(), GeographicLib::AlbersEqualArea::CylindricalEqualArea(), GeographicLib::Geoid::EquatorialRadius(), GeographicLib::UTMUPS::EquatorialRadius(), main(), GeographicLib::LambertConformalConic::Mercator(), Triaxial_Earth_a(), Triaxial_Earth_b(), Triaxial_Earth_c(), GeographicLib::PolarStereographic::UPS(), GeographicLib::TransverseMercator::UTM(), GeographicLib::TransverseMercatorExact::UTM(), GeographicLib::AuxLatitude::WGS84(), GeographicLib::Ellipsoid::WGS84(), GeographicLib::Geocentric::WGS84(), GeographicLib::Geodesic::WGS84(), GeographicLib::GeodesicExact::WGS84(), GeographicLib::NormalGravity::WGS84(), and GeographicLib::Rhumb::WGS84().

## WGS84_f()

template<typename T = real>

T GeographicLib::Constants::WGS84_f | ( |  | ) |

inline static

Template Parameters

  T | the type of the returned value.

Returns
  the flattening of WGS84 ellipsoid (1/298.257223563).

Definition at line 118 of file Constants.hpp.

Referenced by GeographicLib::AlbersEqualArea::AzimuthalEqualAreaNorth(), GeographicLib::AlbersEqualArea::AzimuthalEqualAreaSouth(), GeographicLib::AlbersEqualArea::CylindricalEqualArea(), GeographicLib::Geoid::Flattening(), GeographicLib::UTMUPS::Flattening(), main(), GeographicLib::LambertConformalConic::Mercator(), Triaxial_Earth_c(), GeographicLib::PolarStereographic::UPS(), GeographicLib::TransverseMercator::UTM(), GeographicLib::TransverseMercatorExact::UTM(), GeographicLib::AuxLatitude::WGS84(), GeographicLib::Ellipsoid::WGS84(), GeographicLib::Geocentric::WGS84(), GeographicLib::Geodesic::WGS84(), GeographicLib::GeodesicExact::WGS84(), GeographicLib::NormalGravity::WGS84(), and GeographicLib::Rhumb::WGS84().

## WGS84_GM()

template<typename T = real>

T GeographicLib::Constants::WGS84_GM | ( |  | ) |

inline static

Template Parameters

  T | the type of the returned value.

Returns
  the gravitational constant of the WGS84 ellipsoid, GM, in m3 s−2.

Definition at line 129 of file Constants.hpp.

Referenced by GeographicLib::NormalGravity::WGS84().

## WGS84_omega()

template<typename T = real>

T GeographicLib::Constants::WGS84_omega | ( |  | ) |

inline static

Template Parameters

  T | the type of the returned value.

Returns
  the angular velocity of the WGS84 ellipsoid, ω, in rad s−1.

Definition at line 136 of file Constants.hpp.

Referenced by GeographicLib::NormalGravity::WGS84().

## GRS80_a()

template<typename T = real>

T GeographicLib::Constants::GRS80_a | ( |  | ) |

inline static

Template Parameters

  T | the type of the returned value.

Returns
  the equatorial radius of GRS80 ellipsoid, a, in m.

Definition at line 142 of file Constants.hpp.

References meter().

Referenced by GeographicLib::NormalGravity::GRS80().

## GRS80_GM()

template<typename T = real>

T GeographicLib::Constants::GRS80_GM | ( |  | ) |

inline static

Template Parameters

  T | the type of the returned value.

Returns
  the gravitational constant of the GRS80 ellipsoid, GM, in m3 s−2.

Definition at line 149 of file Constants.hpp.

Referenced by GeographicLib::NormalGravity::GRS80().

## GRS80_omega()

template<typename T = real>

T GeographicLib::Constants::GRS80_omega | ( |  | ) |

inline static

Template Parameters

  T | the type of the returned value.

Returns
  the angular velocity of the GRS80 ellipsoid, ω, in rad s−1.

This is about 2 π 366.25 / (365.25 × 24 × 3600) rad s−1. 365.25 is the number of days in a Julian year and 365.35/366.25 converts from solar days to sidereal days. Using the number of days in a Gregorian year (365.2425) results in a worse approximation (because the Gregorian year includes the precession of the earth's axis).

Definition at line 163 of file Constants.hpp.

Referenced by GeographicLib::NormalGravity::GRS80().

## GRS80_J2()

template<typename T = real>

T GeographicLib::Constants::GRS80_J2 | ( |  | ) |

inline static

Template Parameters

  T | the type of the returned value.

Returns
  the dynamical form factor of the GRS80 ellipsoid, J2.

Definition at line 170 of file Constants.hpp.

Referenced by GeographicLib::NormalGravity::GRS80().

## UTM_k0()

template<typename T = real>

T GeographicLib::Constants::UTM_k0 | ( |  | ) |

inline static

Template Parameters

  T | the type of the returned value.

Returns
  the central scale factor for UTM (0.9996).

Definition at line 176 of file Constants.hpp.

Referenced by main(), GeographicLib::TransverseMercator::UTM(), and GeographicLib::TransverseMercatorExact::UTM().

## UPS_k0()

template<typename T = real>

T GeographicLib::Constants::UPS_k0 | ( |  | ) |

inline static

Template Parameters

  T | the type of the returned value.

Returns
  the central scale factor for UPS (0.994).

Definition at line 182 of file Constants.hpp.

Referenced by GeographicLib::PolarStereographic::UPS().

## Triaxial_Earth_a()

template<typename T = real>

T GeographicLib::Constants::Triaxial_Earth_a | ( |  | ) |

inline static

Template Parameters

  T | the type of the returned value.

Returns
  the major semiaxis of a triaxial approximation to the Earth, a, in m (= 6378172).

Definition at line 211 of file Constants.hpp.

References WGS84_a().

Referenced by GeographicLib::Triaxial::Ellipsoid3::Earth(), and main().

## Triaxial_Earth_b()

template<typename T = real>

T GeographicLib::Constants::Triaxial_Earth_b | ( |  | ) |

inline static

Template Parameters

  T | the type of the returned value.

Returns
  the median semiaxis of a triaxial approximation to the Earth, b, in m (= 6378102).

Definition at line 218 of file Constants.hpp.

References WGS84_a().

Referenced by GeographicLib::Triaxial::Ellipsoid3::Earth(), and main().

## Triaxial_Earth_c()

template<typename T = real>

T GeographicLib::Constants::Triaxial_Earth_c | ( |  | ) |

inline static

Template Parameters

  T | the type of the returned value.

Returns
  the minor semiaxis of a triaxial approximation to the Earth, c, in m (= 6356752).

Definition at line 225 of file Constants.hpp.

References WGS84_a(), and WGS84_f().

Referenced by GeographicLib::Triaxial::Ellipsoid3::Earth(), and main().

## Triaxial_Earth_lon0()

template<typename T = real>

T GeographicLib::Constants::Triaxial_Earth_lon0 | ( |  | ) |

inline static

Template Parameters

  T | the type of the returned value.

Returns
  the longitude, with respect to Greenwich, of the major semiaxis of of a triaxial approximation to the Earth, lon0, in degrees (= −14.93).

Definition at line 233 of file Constants.hpp.

## meter()

template<typename T = real>

T GeographicLib::Constants::meter | ( |  | ) |

inline static

Template Parameters

  T | the type of the returned value.

Returns
  the number of meters in a meter.

This is unity, but this lets the internal system of units be changed if necessary.

Definition at line 247 of file Constants.hpp.

Referenced by foot(), GRS80_a(), kilometer(), nauticalmile(), square_meter(), surveyfoot(), and WGS84_a().

## kilometer()

Math::real GeographicLib::Constants::kilometer | ( |  | ) |

inline static

Returns
  the number of meters in a kilometer.

Definition at line 251 of file Constants.hpp.

References meter().

Referenced by square_kilometer().

## nauticalmile()

Math::real GeographicLib::Constants::nauticalmile | ( |  | ) |

inline static

Returns
  the number of meters in a nautical mile (approximately 1 arc minute)

Definition at line 257 of file Constants.hpp.

References meter().

Referenced by square_nauticalmile().

## square_meter()

template<typename T = real>

T GeographicLib::Constants::square_meter | ( |  | ) |

inline static

Template Parameters

  T | the type of the returned value.

Returns
  the number of square meters in a square meter.

This is unity, but this lets the internal system of units be changed if necessary.

Definition at line 267 of file Constants.hpp.

References meter().

Referenced by hectare().

## hectare()

Math::real GeographicLib::Constants::hectare | ( |  | ) |

inline static

Returns
  the number of square meters in a hectare.

Definition at line 272 of file Constants.hpp.

References square_meter().

## square_kilometer()

Math::real GeographicLib::Constants::square_kilometer | ( |  | ) |

inline static

Returns
  the number of square meters in a square kilometer.

Definition at line 277 of file Constants.hpp.

References kilometer().

## square_nauticalmile()

Math::real GeographicLib::Constants::square_nauticalmile | ( |  | ) |

inline static

Returns
  the number of square meters in a square nautical mile.

Definition at line 282 of file Constants.hpp.

References nauticalmile().

## foot()

Math::real GeographicLib::Constants::foot | ( |  | ) |

inline static

Returns
  the number of meters in an international foot.

Definition at line 292 of file Constants.hpp.

References meter().

Referenced by yard().

## yard()

Math::real GeographicLib::Constants::yard | ( |  | ) |

inline static

Returns
  the number of meters in a yard.

Definition at line 297 of file Constants.hpp.

References foot().

Referenced by chain(), and fathom().

## fathom()

Math::real GeographicLib::Constants::fathom | ( |  | ) |

inline static

Returns
  the number of meters in a fathom.

Definition at line 301 of file Constants.hpp.

References yard().

## chain()

Math::real GeographicLib::Constants::chain | ( |  | ) |

inline static

Returns
  the number of meters in a chain.

Definition at line 305 of file Constants.hpp.

References yard().

Referenced by acre(), and furlong().

## furlong()

Math::real GeographicLib::Constants::furlong | ( |  | ) |

inline static

Returns
  the number of meters in a furlong.

Definition at line 309 of file Constants.hpp.

References chain().

Referenced by acre(), and mile().

## mile()

Math::real GeographicLib::Constants::mile | ( |  | ) |

inline static

Returns
  the number of meters in a statute mile.

Definition at line 313 of file Constants.hpp.

References furlong().

Referenced by square_mile().

## acre()

Math::real GeographicLib::Constants::acre | ( |  | ) |

inline static

Returns
  the number of square meters in an acre.

Definition at line 317 of file Constants.hpp.

References chain(), and furlong().

## square_mile()

Math::real GeographicLib::Constants::square_mile | ( |  | ) |

inline static

Returns
  the number of square meters in a square statute mile.

Definition at line 321 of file Constants.hpp.

References mile().

## surveyfoot()

Math::real GeographicLib::Constants::surveyfoot | ( |  | ) |

inline static

Returns
  the number of meters in a US survey foot.

Definition at line 330 of file Constants.hpp.

References meter().

## Friends And Related Symbol Documentation

## GEOGRAPHICLIB_VERSION_NUM

#define GEOGRAPHICLIB_VERSION_NUM | ( |  | a,
|  |  | b,
|  |  | c )

related

Value:
((((a) * 10000 + (b)) * 100) + (c))

Pack the version components into a single integer. Users should not rely on this particular packing of the components of the version number; see the documentation for GEOGRAPHICLIB_VERSION, below.

Definition at line 21 of file Constants.hpp.

## GEOGRAPHICLIB_VERSION

#define GEOGRAPHICLIB_VERSION

related

Value:
GEOGRAPHICLIB_VERSION_NUM(GEOGRAPHICLIB_VERSION_MAJOR, \
GEOGRAPHICLIB_VERSION_MINOR, \
GEOGRAPHICLIB_VERSION_PATCH)
GeographicLib::Constants::GEOGRAPHICLIB_VERSION_NUM
#define GEOGRAPHICLIB_VERSION_NUM(a, b, c)
Definition Constants.hpp:21

The version of GeographicLib as a single integer, packed as MMmmmmpp where MM is the major version, mmmm is the minor version, and pp is the patch level. Users should not rely on this particular packing of the components of the version number. Instead they should use a test such as

#if GEOGRAPHICLIB_VERSION >= GEOGRAPHICLIB_VERSION_NUM(1,37,0)
...
#endif

Definition at line 34 of file Constants.hpp.

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

- Constants.hpp