GeographicLib  1.21
Static Public Member Functions
GeographicLib::Constants Class Reference

Constants needed by GeographicLib More...

#include <GeographicLib/Constants.hpp>

List of all members.

Static Public Member Functions

static Math::real degree () throw ()
static Math::real arcminute () throw ()
static Math::real arcsecond () throw ()
Ellipsoid parameters
template<typename T >
static T WGS84_a () throw ()
static Math::real WGS84_a () throw ()
template<typename T >
static T WGS84_f () throw ()
static Math::real WGS84_f () throw ()
template<typename T >
static T WGS84_GM () throw ()
template<typename T >
static T WGS84_omega () throw ()
static Math::real WGS84_r () throw ()
template<typename T >
static T GRS80_a () throw ()
template<typename T >
static T GRS80_GM () throw ()
template<typename T >
static T GRS80_omega () throw ()
template<typename T >
static T GRS80_J2 () throw ()
template<typename T >
static T UTM_k0 () throw ()
static Math::real UTM_k0 () throw ()
template<typename T >
static T UPS_k0 () throw ()
static Math::real UPS_k0 () throw ()
SI units
template<typename T >
static T meter () throw ()
static Math::real meter () throw ()
static Math::real kilometer () throw ()
static Math::real nauticalmile () throw ()
template<typename T >
static T square_meter () throw ()
static Math::real square_meter () throw ()
static Math::real hectare () throw ()
static Math::real square_kilometer () throw ()
static Math::real square_nauticalmile () throw ()
Anachronistic British units
static Math::real foot () throw ()
static Math::real yard () throw ()
static Math::real fathom () throw ()
static Math::real chain () throw ()
static Math::real furlong () throw ()
static Math::real mile () throw ()
static Math::real acre () throw ()
static Math::real square_mile () throw ()
Anachronistic US units
static Math::real surveyfoot () throw ()

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
// $Id: c32f14d43abd9e969043dd0506b00c2458763419 $

#include <iostream>
#include <exception>
#include <GeographicLib/Constants.hpp>

using namespace std;
using namespace GeographicLib;

int main() {
  try {
    cout << Constants::WGS84_a() << " 1/" << 1/Constants::WGS84_f() << "\n";
  }
  catch (const exception& e) {
    cerr << "Caught exception: " << e.what() << "\n";
    return 1;
  }
  return 0;
}

Member Function Documentation

static Math::real GeographicLib::Constants::degree ( ) throw () [inline, static]

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

Definition at line 81 of file Constants.hpp.

static Math::real GeographicLib::Constants::arcminute ( ) throw () [inline, static]
Returns:
the number of radians in an arcminute.

Definition at line 85 of file Constants.hpp.

static Math::real GeographicLib::Constants::arcsecond ( ) throw () [inline, static]
Returns:
the number of radians in an arcsecond.

Definition at line 90 of file Constants.hpp.

template<typename T >
static T GeographicLib::Constants::WGS84_a ( ) throw () [inline, static]
Template Parameters:
Tthe type of the returned value.
Returns:
the equatorial radius of WGS84 ellipsoid (6378137 m).

Definition at line 100 of file Constants.hpp.

static Math::real GeographicLib::Constants::WGS84_a ( ) throw () [inline, static]

A synonym for WGS84_a<real>().

Definition at line 105 of file Constants.hpp.

template<typename T >
static T GeographicLib::Constants::WGS84_f ( ) throw () [inline, static]
Template Parameters:
Tthe type of the returned value.
Returns:
the flattening of WGS84 ellipsoid (1/298.257223563).

Definition at line 110 of file Constants.hpp.

static Math::real GeographicLib::Constants::WGS84_f ( ) throw () [inline, static]

A synonym for WGS84_f<real>().

Definition at line 115 of file Constants.hpp.

template<typename T >
static T GeographicLib::Constants::WGS84_GM ( ) throw () [inline, static]
Template Parameters:
Tthe type of the returned value.
Returns:
the gravitational constant of the WGS84 ellipsoid, GM, in m3 s-2.

Definition at line 121 of file Constants.hpp.

template<typename T >
static T GeographicLib::Constants::WGS84_omega ( ) throw () [inline, static]
Template Parameters:
Tthe type of the returned value.
Returns:
the angular velocity of the the WGS84 ellipsoid, omega, in rad s-1.

Definition at line 128 of file Constants.hpp.

static Math::real GeographicLib::Constants::WGS84_r ( ) throw () [inline, static]

Definition at line 142 of file Constants.hpp.

template<typename T >
static T GeographicLib::Constants::GRS80_a ( ) throw () [inline, static]
Template Parameters:
Tthe type of the returned value.
Returns:
the equatorial radius of GRS80 ellipsoid, a, in m.

Definition at line 147 of file Constants.hpp.

template<typename T >
static T GeographicLib::Constants::GRS80_GM ( ) throw () [inline, static]
Template Parameters:
Tthe type of the returned value.
Returns:
the gravitational constant of the GRS80 ellipsoid, GM, in m3 s-2.

Definition at line 154 of file Constants.hpp.

template<typename T >
static T GeographicLib::Constants::GRS80_omega ( ) throw () [inline, static]
Template Parameters:
Tthe type of the returned value.
Returns:
the angular velocity of the the GRS80 ellipsoid, omega, in rad s-1.

This is about 2*pi*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 167 of file Constants.hpp.

template<typename T >
static T GeographicLib::Constants::GRS80_J2 ( ) throw () [inline, static]
Template Parameters:
Tthe type of the returned value.
Returns:
the dynamical form factor of the GRS80 ellipsoid, J2.

Definition at line 174 of file Constants.hpp.

template<typename T >
static T GeographicLib::Constants::UTM_k0 ( ) throw () [inline, static]
Template Parameters:
Tthe type of the returned value.
Returns:
the central scale factor for UTM (0.9996).

Definition at line 180 of file Constants.hpp.

static Math::real GeographicLib::Constants::UTM_k0 ( ) throw () [inline, static]

A synonym for UTM_k0<real>().

Definition at line 185 of file Constants.hpp.

template<typename T >
static T GeographicLib::Constants::UPS_k0 ( ) throw () [inline, static]
Template Parameters:
Tthe type of the returned value.
Returns:
the central scale factor for UPS (0.994).

Definition at line 190 of file Constants.hpp.

static Math::real GeographicLib::Constants::UPS_k0 ( ) throw () [inline, static]

A synonym for UPS_k0<real>().

Definition at line 195 of file Constants.hpp.

template<typename T >
static T GeographicLib::Constants::meter ( ) throw () [inline, static]
Template Parameters:
Tthe 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 208 of file Constants.hpp.

static Math::real GeographicLib::Constants::meter ( ) throw () [inline, static]

A synonym for meter<real>().

Definition at line 212 of file Constants.hpp.

static Math::real GeographicLib::Constants::kilometer ( ) throw () [inline, static]
Returns:
the number of meters in a kilometer.

Definition at line 216 of file Constants.hpp.

static Math::real GeographicLib::Constants::nauticalmile ( ) throw () [inline, static]
Returns:
the number of meters in a nautical mile (approximately 1 arc minute)

Definition at line 222 of file Constants.hpp.

template<typename T >
static T GeographicLib::Constants::square_meter ( ) throw () [inline, static]
Template Parameters:
Tthe 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 232 of file Constants.hpp.

static Math::real GeographicLib::Constants::square_meter ( ) throw () [inline, static]

A synonym for square_meter<real>().

Definition at line 237 of file Constants.hpp.

static Math::real GeographicLib::Constants::hectare ( ) throw () [inline, static]
Returns:
the number of square meters in a hectare.

Definition at line 242 of file Constants.hpp.

static Math::real GeographicLib::Constants::square_kilometer ( ) throw () [inline, static]
Returns:
the number of square meters in a square kilometer.

Definition at line 247 of file Constants.hpp.

static Math::real GeographicLib::Constants::square_nauticalmile ( ) throw () [inline, static]
Returns:
the number of square meters in a square nautical mile.

Definition at line 252 of file Constants.hpp.

static Math::real GeographicLib::Constants::foot ( ) throw () [inline, static]
Returns:
the number of meters in an international foot.

Definition at line 262 of file Constants.hpp.

static Math::real GeographicLib::Constants::yard ( ) throw () [inline, static]
Returns:
the number of meters in a yard.

Definition at line 267 of file Constants.hpp.

static Math::real GeographicLib::Constants::fathom ( ) throw () [inline, static]
Returns:
the number of meters in a fathom.

Definition at line 271 of file Constants.hpp.

static Math::real GeographicLib::Constants::chain ( ) throw () [inline, static]
Returns:
the number of meters in a chain.

Definition at line 275 of file Constants.hpp.

static Math::real GeographicLib::Constants::furlong ( ) throw () [inline, static]
Returns:
the number of meters in a furlong.

Definition at line 279 of file Constants.hpp.

static Math::real GeographicLib::Constants::mile ( ) throw () [inline, static]
Returns:
the number of meters in a statute mile.

Definition at line 283 of file Constants.hpp.

static Math::real GeographicLib::Constants::acre ( ) throw () [inline, static]
Returns:
the number of square meters in an acre.

Definition at line 287 of file Constants.hpp.

static Math::real GeographicLib::Constants::square_mile ( ) throw () [inline, static]
Returns:
the number of square meters in a square statute mile.

Definition at line 291 of file Constants.hpp.

static Math::real GeographicLib::Constants::surveyfoot ( ) throw () [inline, static]
Returns:
the number of meters in a US survey foot.

Definition at line 300 of file Constants.hpp.


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