10 #if !defined(GEOGRAPHICLIB_CONSTANTS_HPP)
11 #define GEOGRAPHICLIB_CONSTANTS_HPP 1
13 #include <GeographicLib/Config.h>
21 #define GEOGRAPHICLIB_VERSION_NUM(a,b,c) ((((a) * 10000 + (b)) * 100) + (c))
34 #define GEOGRAPHICLIB_VERSION \
35 GEOGRAPHICLIB_VERSION_NUM(GEOGRAPHICLIB_VERSION_MAJOR, \
36 GEOGRAPHICLIB_VERSION_MINOR, \
37 GEOGRAPHICLIB_VERSION_PATCH)
43 #if !defined(GEOGRAPHICLIB_HAS_STATIC_ASSERT)
44 # if __cplusplus >= 201103 || defined(__GXX_EXPERIMENTAL_CXX0X__)
45 # define GEOGRAPHICLIB_HAS_STATIC_ASSERT 1
46 # elif defined(_MSC_VER) && _MSC_VER >= 1600
61 # define GEOGRAPHICLIB_HAS_STATIC_ASSERT 1
63 # define GEOGRAPHICLIB_HAS_STATIC_ASSERT 0
71 #if !defined(GEOGRAPHICLIB_STATIC_ASSERT)
72 # if GEOGRAPHICLIB_HAS_STATIC_ASSERT
73 # define GEOGRAPHICLIB_STATIC_ASSERT static_assert
75 # define GEOGRAPHICLIB_STATIC_ASSERT(cond,reason) \
76 { enum{ GEOGRAPHICLIB_STATIC_ASSERT_ENUM = 1/int(cond) }; }
80 #if defined(_MSC_VER) && defined(GEOGRAPHICLIB_SHARED_LIB) && \
81 GEOGRAPHICLIB_SHARED_LIB
82 # if GEOGRAPHICLIB_SHARED_LIB > 1
83 # error GEOGRAPHICLIB_SHARED_LIB must be 0 or 1
84 # elif defined(GeographicLib_EXPORTS)
85 # define GEOGRAPHICLIB_EXPORT __declspec(dllexport)
87 # define GEOGRAPHICLIB_EXPORT __declspec(dllimport)
90 # define GEOGRAPHICLIB_EXPORT
143 template<
typename T>
static inline T
WGS84_a()
144 {
return 6378137 * meter<T>(); }
153 template<
typename T>
static inline T
WGS84_f() {
157 return 1 / ( T(298257223563LL) / 1000000000 );
169 {
return T(3986004) * 100000000 + 41800000; }
180 {
return 7292115 / (T(1000000) * 100000); }
190 template<
typename T>
static inline T WGS84_r()
191 {
return 1/WGS84_f<T>(); }
196 static inline Math::real WGS84_r() {
return WGS84_r<real>(); }
202 template<
typename T>
static inline T
GRS80_a()
203 {
return 6378137 * meter<T>(); }
214 {
return T(3986005) * 100000000; }
232 {
return 7292115 / (T(1000000) * 100000); }
243 {
return T(108263) / 100000000; }
252 template<
typename T>
static inline T
UTM_k0()
253 {
return T(9996) / 10000; }
262 template<
typename T>
static inline T
UPS_k0()
263 {
return T(994) / 1000; }
280 template<
typename T>
static inline T
meter() {
return T(1); }
289 {
return 1000 * meter<real>(); }
295 {
return 1852 * meter<real>(); }
305 {
return meter<real>() * meter<real>(); }
310 {
return square_meter<real>(); }
315 {
return 10000 * square_meter<real>(); }
320 {
return kilometer() * kilometer(); }
325 {
return nauticalmile() * nauticalmile(); }
335 {
return real(254 * 12) / 10000 * meter<real>(); }
373 {
return real(1200) / 3937 * meter<real>(); }
400 #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)