10 #if !defined(GEOGRAPHICLIB_CONSTANTS_HPP)
11 #define GEOGRAPHICLIB_CONSTANTS_HPP 1
13 #include <GeographicLib/Config.h>
18 #if !defined(STATIC_ASSERT)
19 # if __cplusplus >= 201103
20 # define STATIC_ASSERT static_assert
21 # elif defined(__GXX_EXPERIMENTAL_CXX0X__)
22 # define STATIC_ASSERT static_assert
23 # elif defined(_MSC_VER) && _MSC_VER >= 1600
35 # define STATIC_ASSERT static_assert
37 # define STATIC_ASSERT(cond,reason) \
38 { enum{ STATIC_ASSERT_ENUM = 1/int(cond) }; }
42 #if defined(_MSC_VER) && defined(GEOGRAPHICLIB_SHARED_LIB) && \
43 GEOGRAPHICLIB_SHARED_LIB
44 # if GEOGRAPHICLIB_SHARED_LIB > 1
45 # error GEOGRAPHICLIB_SHARED_LIB must be 0 or 1
46 # elif defined(GeographicLib_EXPORTS)
47 # define GEOGRAPHICLIB_EXPORT __declspec(dllexport)
49 # define GEOGRAPHICLIB_EXPORT __declspec(dllimport)
52 # define GEOGRAPHICLIB_EXPORT
66 namespace GeographicLib {
91 {
return Math::degree<real>() / 60; }
96 {
return Math::degree<real>() / 3600; }
105 template<
typename T>
static inline T
WGS84_a() throw()
106 {
return T(6378137) * meter<T>(); }
115 template<
typename T>
static inline T
WGS84_f() throw()
116 {
return T(1) / ( T(298) + T(257223563) / T(1000000000) ); }
126 template<
typename T>
static inline T
WGS84_GM() throw()
127 {
return T(3986004) * T(100000000) + T(41800000); }
134 {
return T(7292115) / (T(1000000) * T(100000)); }
140 template<
typename T>
static inline T WGS84_r() throw()
141 {
return 1/WGS84_f<T>(); }
146 static inline Math::real WGS84_r() throw() {
return WGS84_r<real>(); }
152 template<
typename T>
static inline T
GRS80_a() throw()
153 {
return T(6378137); }
159 template<
typename T>
static inline T
GRS80_GM() throw()
160 {
return T(3986005) * T(100000000); }
174 {
return T(7292115) / (T(1000000) * T(100000)); }
180 template<
typename T>
static inline T
GRS80_J2() throw()
181 {
return T(108263) / T(100000000); }
186 template<
typename T>
static inline T
UTM_k0() throw()
187 {
return T(9996) / T(10000); }
196 template<
typename T>
static inline T
UPS_k0() throw()
197 {
return T(994) / T(1000); }
214 template<
typename T>
static inline T
meter() throw() {
return T(1); }
223 {
return 1000 * meter<real>(); }
229 {
return 1852 * meter<real>(); }
239 {
return meter<real>() * meter<real>(); }
244 {
return square_meter<real>(); }
249 {
return 10000 * square_meter<real>(); }
254 {
return kilometer() * kilometer(); }
259 {
return nauticalmile() * nauticalmile(); }
269 {
return real(0.0254L) * 12 * meter<real>(); }
307 {
return real(1200) /
real(3937) * meter<real>(); }
334 #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()
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 meter()
static Math::real degree()
static Math::real fathom()
static Math::real UTM_k0()
Header for GeographicLib::Math class.
static Math::real chain()
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 square_mile()
static Math::real WGS84_f()
GeographicErr(const std::string &msg)