#if !defined(GEOGRAPHICLIB_CONSTANTS_HPP)
#define GEOGRAPHICLIB_CONSTANTS_HPP 1
#include <GeographicLib/Config.h>
#define GEOGRAPHICLIB_VERSION_NUM(a,b,c) ((((a) * 10000 + (b)) * 100) + (c))
#define GEOGRAPHICLIB_VERSION \
GEOGRAPHICLIB_VERSION_NUM(GEOGRAPHICLIB_VERSION_MAJOR, \
GEOGRAPHICLIB_VERSION_MINOR, \
GEOGRAPHICLIB_VERSION_PATCH)
#if defined(_MSC_VER) && defined(GEOGRAPHICLIB_SHARED_LIB) && \
GEOGRAPHICLIB_SHARED_LIB
# if GEOGRAPHICLIB_SHARED_LIB > 1
# error GEOGRAPHICLIB_SHARED_LIB must be 0 or 1
# elif defined(GeographicLib_SHARED_EXPORTS)
# define GEOGRAPHICLIB_EXPORT __declspec(dllexport)
# else
# define GEOGRAPHICLIB_EXPORT __declspec(dllimport)
# endif
#else
# define GEOGRAPHICLIB_EXPORT
#endif
#if defined(__GNUC__)
# if __GNUC__ > 4
# define GEOGRAPHICLIB_DEPRECATED(msg) __attribute__((deprecated(msg)))
# else
# define GEOGRAPHICLIB_DEPRECATED(msg) __attribute__((deprecated))
# endif
#elif defined(_MSC_VER) && _MSC_VER >= 1300
# define GEOGRAPHICLIB_DEPRECATED(msg) __declspec(deprecated(msg))
#else
# define GEOGRAPHICLIB_DEPRECATED(msg)
#endif
#include <stdexcept>
#include <string>
#include <GeographicLib/Math.hpp>
namespace GeographicLib {
class GEOGRAPHICLIB_EXPORT Constants {
private:
typedef Math::real real;
Constants() = delete;
public:
static Math::real degree() { return Math::degree(); }
static Math::real arcminute()
{ return Math::degree() / Math::dm; }
static Math::real arcsecond()
{ return Math::degree() / Math::ds; }
template<typename T = real> static T WGS84_a()
{ return 6378137 * meter<T>(); }
template<typename T = real> static T WGS84_f() {
return 1 / ( T(298257223563LL) / 1000000000 );
}
template<typename T = real> static T WGS84_GM()
{ return T(3986004) * 100000000 + 41800000; }
template<typename T = real> static T WGS84_omega()
{ return 7292115 / (T(1000000) * 100000); }
template<typename T = real> static T GRS80_a()
{ return 6378137 * meter<T>(); }
template<typename T = real> static T GRS80_GM()
{ return T(3986005) * 100000000; }
template<typename T = real> static T GRS80_omega()
{ return 7292115 / (T(1000000) * 100000); }
template<typename T = real> static T GRS80_J2()
{ return T(108263) / 100000000; }
template<typename T = real> static T UTM_k0()
{return T(9996) / 10000; }
template<typename T = real> static T UPS_k0()
{ return T(994) / 1000; }
template<typename T = real> static T meter() { return T(1); }
static Math::real kilometer()
{ return 1000 * meter<real>(); }
static Math::real nauticalmile()
{ return 1852 * meter<real>(); }
template<typename T = real> static T square_meter()
{ return meter<T>() * meter<T>(); }
static Math::real hectare()
{ return 10000 * square_meter<real>(); }
static Math::real square_kilometer()
{ return kilometer() * kilometer(); }
static Math::real square_nauticalmile()
{ return nauticalmile() * nauticalmile(); }
static Math::real foot()
{ return real(254 * 12) / 10000 * meter<real>(); }
static Math::real yard() { return 3 * foot(); }
static Math::real fathom() { return 2 * yard(); }
static Math::real chain() { return 22 * yard(); }
static Math::real furlong() { return 10 * chain(); }
static Math::real mile() { return 8 * furlong(); }
static Math::real acre() { return chain() * furlong(); }
static Math::real square_mile() { return mile() * mile(); }
static Math::real surveyfoot()
{ return real(1200) / 3937 * meter<real>(); }
};
class GeographicErr : public std::runtime_error {
public:
GeographicErr(const std::string& msg) : std::runtime_error(msg) {}
};
}
#endif