GeographicLib  1.35
Static Public Member Functions | List of all members
GeographicLib::Constants Class Reference

Constants needed by GeographicLib More...

#include <GeographicLib/Constants.hpp>

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 ()
 
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
#include <iostream>
#include <exception>
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;
}
return 0;
}

Definition at line 77 of file Constants.hpp.

Member Function Documentation

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

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

Definition at line 86 of file Constants.hpp.

static Math::real GeographicLib::Constants::arcminute ( )
throw (
)
inlinestatic
Returns
the number of radians in an arcminute.

Definition at line 90 of file Constants.hpp.

static Math::real GeographicLib::Constants::arcsecond ( )
throw (
)
inlinestatic
Returns
the number of radians in an arcsecond.

Definition at line 95 of file Constants.hpp.

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

Definition at line 105 of file Constants.hpp.

static Math::real GeographicLib::Constants::WGS84_a ( )
throw (
)
inlinestatic

A synonym for WGS84_a<real>().

Definition at line 110 of file Constants.hpp.

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

Definition at line 115 of file Constants.hpp.

static Math::real GeographicLib::Constants::WGS84_f ( )
throw (
)
inlinestatic

A synonym for WGS84_f<real>().

Definition at line 120 of file Constants.hpp.

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

Definition at line 126 of file Constants.hpp.

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

Definition at line 133 of file Constants.hpp.

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

Definition at line 152 of file Constants.hpp.

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

Definition at line 159 of file Constants.hpp.

template<typename T >
static T GeographicLib::Constants::GRS80_omega ( )
throw (
)
inlinestatic
Template Parameters
Tthe 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 173 of file Constants.hpp.

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

Definition at line 180 of file Constants.hpp.

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

Definition at line 186 of file Constants.hpp.

static Math::real GeographicLib::Constants::UTM_k0 ( )
throw (
)
inlinestatic

A synonym for UTM_k0<real>().

Definition at line 191 of file Constants.hpp.

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

Definition at line 196 of file Constants.hpp.

static Math::real GeographicLib::Constants::UPS_k0 ( )
throw (
)
inlinestatic

A synonym for UPS_k0<real>().

Definition at line 201 of file Constants.hpp.

template<typename T >
static T GeographicLib::Constants::meter ( )
throw (
)
inlinestatic
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 214 of file Constants.hpp.

static Math::real GeographicLib::Constants::meter ( )
throw (
)
inlinestatic

A synonym for meter<real>().

Definition at line 218 of file Constants.hpp.

static Math::real GeographicLib::Constants::kilometer ( )
throw (
)
inlinestatic
Returns
the number of meters in a kilometer.

Definition at line 222 of file Constants.hpp.

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

Definition at line 228 of file Constants.hpp.

template<typename T >
static T GeographicLib::Constants::square_meter ( )
throw (
)
inlinestatic
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 238 of file Constants.hpp.

static Math::real GeographicLib::Constants::square_meter ( )
throw (
)
inlinestatic

A synonym for square_meter<real>().

Definition at line 243 of file Constants.hpp.

static Math::real GeographicLib::Constants::hectare ( )
throw (
)
inlinestatic
Returns
the number of square meters in a hectare.

Definition at line 248 of file Constants.hpp.

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

Definition at line 253 of file Constants.hpp.

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

Definition at line 258 of file Constants.hpp.

static Math::real GeographicLib::Constants::foot ( )
throw (
)
inlinestatic
Returns
the number of meters in an international foot.

Definition at line 268 of file Constants.hpp.

static Math::real GeographicLib::Constants::yard ( )
throw (
)
inlinestatic
Returns
the number of meters in a yard.

Definition at line 273 of file Constants.hpp.

static Math::real GeographicLib::Constants::fathom ( )
throw (
)
inlinestatic
Returns
the number of meters in a fathom.

Definition at line 277 of file Constants.hpp.

static Math::real GeographicLib::Constants::chain ( )
throw (
)
inlinestatic
Returns
the number of meters in a chain.

Definition at line 281 of file Constants.hpp.

static Math::real GeographicLib::Constants::furlong ( )
throw (
)
inlinestatic
Returns
the number of meters in a furlong.

Definition at line 285 of file Constants.hpp.

static Math::real GeographicLib::Constants::mile ( )
throw (
)
inlinestatic
Returns
the number of meters in a statute mile.

Definition at line 289 of file Constants.hpp.

static Math::real GeographicLib::Constants::acre ( )
throw (
)
inlinestatic
Returns
the number of square meters in an acre.

Definition at line 293 of file Constants.hpp.

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

Definition at line 297 of file Constants.hpp.

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

Definition at line 306 of file Constants.hpp.


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