10 #if !defined(GEOGRAPHICLIB_CONSTANTS_HPP)
11 #define GEOGRAPHICLIB_CONSTANTS_HPP 1
13 #include <GeographicLib/Config.h>
19 #define GEOGRAPHICLIB_VERSION_NUM(a,b,c) ((((a) * 10000 + (b)) * 100) + (c))
27 #define GEOGRAPHICLIB_VERSION \
28 GEOGRAPHICLIB_VERSION_NUM(GEOGRAPHICLIB_VERSION_MAJOR, \
29 GEOGRAPHICLIB_VERSION_MINOR, \
30 GEOGRAPHICLIB_VERSION_PATCH)
36 #if !defined(GEOGRAPHICLIB_STATIC_ASSERT)
37 # if __cplusplus >= 201103 || defined(__GXX_EXPERIMENTAL_CXX0X__)
38 # define GEOGRAPHICLIB_STATIC_ASSERT static_assert
39 # elif defined(_MSC_VER) && _MSC_VER >= 1600
52 # define GEOGRAPHICLIB_STATIC_ASSERT static_assert
54 # define GEOGRAPHICLIB_STATIC_ASSERT(cond,reason) \
55 { enum{ GEOGRAPHICLIB_STATIC_ASSERT_ENUM = 1/int(cond) }; }
59 #if defined(_MSC_VER) && defined(GEOGRAPHICLIB_SHARED_LIB) && \
60 GEOGRAPHICLIB_SHARED_LIB
61 # if GEOGRAPHICLIB_SHARED_LIB > 1
62 # error GEOGRAPHICLIB_SHARED_LIB must be 0 or 1
63 # elif defined(GeographicLib_EXPORTS)
64 # define GEOGRAPHICLIB_EXPORT __declspec(dllexport)
66 # define GEOGRAPHICLIB_EXPORT __declspec(dllimport)
69 # define GEOGRAPHICLIB_EXPORT
122 template<
typename T>
static inline T
WGS84_a()
123 {
return 6378137 * meter<T>(); }
132 template<
typename T>
static inline T
WGS84_f()
133 {
return 1 / ( T(298257223563LL) / 1000000000 ); }
144 {
return T(3986004) * 100000000 + 41800000; }
155 {
return 7292115 / (T(1000000) * 100000); }
165 template<
typename T>
static inline T WGS84_r()
166 {
return 1/WGS84_f<T>(); }
171 static inline Math::real WGS84_r() {
return WGS84_r<real>(); }
177 template<
typename T>
static inline T
GRS80_a()
178 {
return 6378137 * meter<T>(); }
189 {
return T(3986005) * 100000000; }
207 {
return 7292115 / (T(1000000) * 100000); }
218 {
return T(108263) / 100000000; }
227 template<
typename T>
static inline T
UTM_k0()
228 {
return T(9996) / 10000; }
237 template<
typename T>
static inline T
UPS_k0()
238 {
return T(994) / 1000; }
255 template<
typename T>
static inline T
meter() {
return T(1); }
264 {
return 1000 * meter<real>(); }
270 {
return 1852 * meter<real>(); }
280 {
return meter<real>() * meter<real>(); }
285 {
return square_meter<real>(); }
290 {
return 10000 * square_meter<real>(); }
295 {
return kilometer() * kilometer(); }
300 {
return nauticalmile() * nauticalmile(); }
310 {
return real(254 * 12) / 10000 * meter<real>(); }
348 {
return real(1200) / 3937 * meter<real>(); }
375 #endif // GEOGRAPHICLIB_CONSTANTS_HPP
static Math::real arcminute()
static Math::real kilometer()
#define GEOGRAPHICLIB_EXPORT
static Math::real UPS_k0()
static Math::real square_nauticalmile()
static Math::real WGS84_omega()
GeographicLib::Math::real real
static Math::real nauticalmile()
static Math::real arcsecond()
static Math::real surveyfoot()
static Math::real furlong()
static Math::real hectare()
static Math::real GRS80_omega()
static Math::real meter()
static Math::real degree()
static Math::real fathom()
static Math::real UTM_k0()
Header for GeographicLib::Math class.
static Math::real chain()
Namespace for GeographicLib.
static Math::real WGS84_GM()
static Math::real square_meter()
Constants needed by GeographicLib
static Math::real WGS84_a()
Exception handling for GeographicLib.
static Math::real square_kilometer()
static Math::real GRS80_a()
static Math::real square_mile()
static Math::real GRS80_GM()
static Math::real GRS80_J2()
static Math::real WGS84_f()
GeographicErr(const std::string &msg)