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
38 # define GEOGRAPHICLIB_STATIC_ASSERT static_assert
39 # elif defined(__GXX_EXPERIMENTAL_CXX0X__)
40 # define GEOGRAPHICLIB_STATIC_ASSERT static_assert
41 # elif defined(_MSC_VER) && _MSC_VER >= 1600
53 # define GEOGRAPHICLIB_STATIC_ASSERT static_assert
55 # define GEOGRAPHICLIB_STATIC_ASSERT(cond,reason) \
56 { enum{ GEOGRAPHICLIB_STATIC_ASSERT_ENUM = 1/int(cond) }; }
60 #if defined(_MSC_VER) && defined(GEOGRAPHICLIB_SHARED_LIB) && \
61 GEOGRAPHICLIB_SHARED_LIB
62 # if GEOGRAPHICLIB_SHARED_LIB > 1
63 # error GEOGRAPHICLIB_SHARED_LIB must be 0 or 1
64 # elif defined(GeographicLib_EXPORTS)
65 # define GEOGRAPHICLIB_EXPORT __declspec(dllexport)
67 # define GEOGRAPHICLIB_EXPORT __declspec(dllimport)
70 # define GEOGRAPHICLIB_EXPORT
84 namespace GeographicLib {
123 template<
typename T>
static inline T WGS84_a()
124 {
return 6378137 * meter<T>(); }
133 template<
typename T>
static inline T WGS84_f()
134 {
return 1 / ( T(298257223563LL) / 1000000000 ); }
144 template<
typename T>
static inline T WGS84_GM()
145 {
return T(3986004) * 100000000 + 41800000; }
155 template<
typename T>
static inline T WGS84_omega()
156 {
return 7292115 / (T(1000000) * 100000); }
166 template<
typename T>
static inline T WGS84_r()
167 {
return 1/WGS84_f<T>(); }
172 static inline Math::real WGS84_r() {
return WGS84_r<real>(); }
178 template<
typename T>
static inline T GRS80_a()
179 {
return 6378137 * meter<T>(); }
189 template<
typename T>
static inline T GRS80_GM()
190 {
return T(3986005) * 100000000; }
207 template<
typename T>
static inline T GRS80_omega()
208 {
return 7292115 / (T(1000000) * 100000); }
218 template<
typename T>
static inline T GRS80_J2()
219 {
return T(108263) / 100000000; }
228 template<
typename T>
static inline T UTM_k0()
229 {
return T(9996) / 10000; }
238 template<
typename T>
static inline T UPS_k0()
239 {
return T(994) / 1000; }
256 template<
typename T>
static inline T
meter() {
return T(1); }
265 {
return 1000 * meter<real>(); }
271 {
return 1852 * meter<real>(); }
280 template<
typename T>
static inline T square_meter()
281 {
return meter<real>() * meter<real>(); }
286 {
return square_meter<real>(); }
291 {
return 10000 * square_meter<real>(); }
296 {
return kilometer() * kilometer(); }
301 {
return nauticalmile() * nauticalmile(); }
311 {
return real(254 * 12) / 10000 * meter<real>(); }
349 {
return real(1200) / 3937 * meter<real>(); }
376 #endif // GEOGRAPHICLIB_CONSTANTS_HPP