Static Public Member Functions | Private Types | Private Member Functions | Related Functions | List of all members
GeographicLib::Constants Class Reference

Constants needed by GeographicLib More...

#include <Constants.hpp>

Static Public Member Functions

static Math::real arcminute ()
 
static Math::real arcsecond ()
 
static Math::real degree ()
 
Ellipsoid parameters
template<typename T >
static T WGS84_a ()
 
static Math::real WGS84_a ()
 
template<typename T >
static T WGS84_f ()
 
static Math::real WGS84_f ()
 
template<typename T >
static T WGS84_GM ()
 
static Math::real WGS84_GM ()
 
template<typename T >
static T WGS84_omega ()
 
static Math::real WGS84_omega ()
 
template<typename T >
static T GRS80_a ()
 
static Math::real GRS80_a ()
 
template<typename T >
static T GRS80_GM ()
 
static Math::real GRS80_GM ()
 
template<typename T >
static T GRS80_omega ()
 
static Math::real GRS80_omega ()
 
template<typename T >
static T GRS80_J2 ()
 
static Math::real GRS80_J2 ()
 
template<typename T >
static T UTM_k0 ()
 
static Math::real UTM_k0 ()
 
template<typename T >
static T UPS_k0 ()
 
static Math::real UPS_k0 ()
 
SI units
template<typename T >
static T meter ()
 
static Math::real meter ()
 
static Math::real kilometer ()
 
static Math::real nauticalmile ()
 
template<typename T >
static T square_meter ()
 
static Math::real 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 ()
 

Private Types

typedef Math::real real
 

Private Member Functions

 Constants ()
 

Related Functions

(Note that these are not member functions.)

#define GEOGRAPHICLIB_HAS_STATIC_ASSERT   0
 
#define GEOGRAPHICLIB_STATIC_ASSERT(cond, reason)   { enum{ GEOGRAPHICLIB_STATIC_ASSERT_ENUM = 1/int(cond) }; }
 
#define GEOGRAPHICLIB_VERSION
 
#define GEOGRAPHICLIB_VERSION_NUM(a, b, c)   ((((a) * 10000 + (b)) * 100) + (c))
 

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;
}
}

Definition at line 131 of file Constants.hpp.

Member Typedef Documentation

◆ real

Definition at line 133 of file Constants.hpp.

Constructor & Destructor Documentation

◆ Constants()

GeographicLib::Constants::Constants ( )
private

Member Function Documentation

◆ acre()

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

Definition at line 362 of file Constants.hpp.

◆ arcminute()

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

Definition at line 144 of file Constants.hpp.

◆ arcsecond()

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

Definition at line 149 of file Constants.hpp.

◆ chain()

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

Definition at line 350 of file Constants.hpp.

◆ degree()

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

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

Definition at line 140 of file Constants.hpp.

◆ fathom()

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

Definition at line 346 of file Constants.hpp.

◆ foot()

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

Definition at line 337 of file Constants.hpp.

◆ furlong()

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

Definition at line 354 of file Constants.hpp.

◆ GRS80_a() [1/2]

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

Definition at line 205 of file Constants.hpp.

◆ GRS80_a() [2/2]

static Math::real GeographicLib::Constants::GRS80_a ( )
inlinestatic

A synonym for GRS80_a<real>().

Definition at line 210 of file Constants.hpp.

◆ GRS80_GM() [1/2]

template<typename T >
static T GeographicLib::Constants::GRS80_GM ( )
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 216 of file Constants.hpp.

◆ GRS80_GM() [2/2]

static Math::real GeographicLib::Constants::GRS80_GM ( )
inlinestatic

A synonym for GRS80_GM<real>().

Definition at line 221 of file Constants.hpp.

◆ GRS80_J2() [1/2]

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

Definition at line 245 of file Constants.hpp.

◆ GRS80_J2() [2/2]

static Math::real GeographicLib::Constants::GRS80_J2 ( )
inlinestatic

A synonym for GRS80_J2<real>().

Definition at line 250 of file Constants.hpp.

◆ GRS80_omega() [1/2]

template<typename T >
static T GeographicLib::Constants::GRS80_omega ( )
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 234 of file Constants.hpp.

◆ GRS80_omega() [2/2]

static Math::real GeographicLib::Constants::GRS80_omega ( )
inlinestatic

A synonym for GRS80_omega<real>().

Definition at line 239 of file Constants.hpp.

◆ hectare()

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

Definition at line 317 of file Constants.hpp.

◆ kilometer()

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

Definition at line 291 of file Constants.hpp.

◆ meter() [1/2]

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

◆ meter() [2/2]

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

A synonym for meter<real>().

Definition at line 287 of file Constants.hpp.

◆ mile()

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

Definition at line 358 of file Constants.hpp.

◆ nauticalmile()

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

Definition at line 297 of file Constants.hpp.

◆ square_kilometer()

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

Definition at line 322 of file Constants.hpp.

◆ square_meter() [1/2]

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

◆ square_meter() [2/2]

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

A synonym for square_meter<real>().

Definition at line 312 of file Constants.hpp.

◆ square_mile()

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

Definition at line 366 of file Constants.hpp.

◆ square_nauticalmile()

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

Definition at line 327 of file Constants.hpp.

◆ surveyfoot()

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

Definition at line 375 of file Constants.hpp.

◆ UPS_k0() [1/2]

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

Definition at line 265 of file Constants.hpp.

◆ UPS_k0() [2/2]

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

A synonym for UPS_k0<real>().

Definition at line 270 of file Constants.hpp.

◆ UTM_k0() [1/2]

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

Definition at line 255 of file Constants.hpp.

◆ UTM_k0() [2/2]

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

A synonym for UTM_k0<real>().

Definition at line 260 of file Constants.hpp.

◆ WGS84_a() [1/2]

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

Definition at line 159 of file Constants.hpp.

◆ WGS84_a() [2/2]

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

A synonym for WGS84_a<real>().

Definition at line 164 of file Constants.hpp.

◆ WGS84_f() [1/2]

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

Definition at line 169 of file Constants.hpp.

◆ WGS84_f() [2/2]

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

A synonym for WGS84_f<real>().

Definition at line 178 of file Constants.hpp.

◆ WGS84_GM() [1/2]

template<typename T >
static T GeographicLib::Constants::WGS84_GM ( )
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 184 of file Constants.hpp.

◆ WGS84_GM() [2/2]

static Math::real GeographicLib::Constants::WGS84_GM ( )
inlinestatic

A synonym for WGS84_GM<real>().

Definition at line 189 of file Constants.hpp.

◆ WGS84_omega() [1/2]

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

Definition at line 195 of file Constants.hpp.

◆ WGS84_omega() [2/2]

static Math::real GeographicLib::Constants::WGS84_omega ( )
inlinestatic

A synonym for WGS84_omega<real>().

Definition at line 200 of file Constants.hpp.

◆ yard()

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

Definition at line 342 of file Constants.hpp.

Friends And Related Function Documentation

◆ GEOGRAPHICLIB_HAS_STATIC_ASSERT

#define GEOGRAPHICLIB_HAS_STATIC_ASSERT   0
related

Is the C++11 static_assert available?

Definition at line 64 of file Constants.hpp.

◆ GEOGRAPHICLIB_STATIC_ASSERT

#define GEOGRAPHICLIB_STATIC_ASSERT (   cond,
  reason 
)    { enum{ GEOGRAPHICLIB_STATIC_ASSERT_ENUM = 1/int(cond) }; }
related

A compile-time assert. Use C++11 static_assert, if available.

Definition at line 76 of file Constants.hpp.

◆ GEOGRAPHICLIB_VERSION

#define GEOGRAPHICLIB_VERSION
related
Value:

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.

◆ GEOGRAPHICLIB_VERSION_NUM

#define GEOGRAPHICLIB_VERSION_NUM (   a,
  b,
  c 
)    ((((a) * 10000 + (b)) * 100) + (c))
related

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.


The documentation for this class was generated from the following file:
e
Array< double, 1, 3 > e(1./3., 0.5, 2.)
GeographicLib
Namespace for GeographicLib.
Definition: JacobiConformal.hpp:15
main
int main(int argc, char **argv)
Definition: cmake/example_cmake_find_gtsam/main.cpp:63
GeographicLib::Constants::GEOGRAPHICLIB_VERSION_NUM
#define GEOGRAPHICLIB_VERSION_NUM(a, b, c)
Definition: Constants.hpp:21
GEOGRAPHICLIB_VERSION_MINOR
#define GEOGRAPHICLIB_VERSION_MINOR
Definition: Config.h:5
Constants.hpp
Header for GeographicLib::Constants class.
GeographicLib::Constants::WGS84_a
static T WGS84_a()
Definition: Constants.hpp:159
std
Definition: BFloat16.h:88
GEOGRAPHICLIB_VERSION_MAJOR
#define GEOGRAPHICLIB_VERSION_MAJOR
Definition: Config.h:4
GeographicLib::Constants::WGS84_f
static T WGS84_f()
Definition: Constants.hpp:169
GEOGRAPHICLIB_VERSION_PATCH
#define GEOGRAPHICLIB_VERSION_PATCH
Definition: Config.h:6


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:15:06