GeographicLib: Constants.hpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10#if !defined(GEOGRAPHICLIB_CONSTANTS_HPP)

11#define GEOGRAPHICLIB_CONSTANTS_HPP 1

12

13#include <GeographicLib/Config.h>

14

15

16

17

18

19

20

21#define GEOGRAPHICLIB_VERSION_NUM(a,b,c) ((((a) * 10000 + (b)) * 100) + (c))

22

23

24

25

26

27

28

29

30

31

32

33

34#define GEOGRAPHICLIB_VERSION \

35 GEOGRAPHICLIB_VERSION_NUM(GEOGRAPHICLIB_VERSION_MAJOR, \

36 GEOGRAPHICLIB_VERSION_MINOR, \

37 GEOGRAPHICLIB_VERSION_PATCH)

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57#if defined(_MSC_VER) && defined(GEOGRAPHICLIB_SHARED_LIB) && \

58 GEOGRAPHICLIB_SHARED_LIB

59# if GEOGRAPHICLIB_SHARED_LIB > 1

60# error GEOGRAPHICLIB_SHARED_LIB must be 0 or 1

61# elif defined(GeographicLib_SHARED_EXPORTS)

62# define GEOGRAPHICLIB_EXPORT __declspec(dllexport)

63# else

64# define GEOGRAPHICLIB_EXPORT __declspec(dllimport)

65# endif

66#else

67# define GEOGRAPHICLIB_EXPORT

68#endif

69

70

71

72

73#if defined(__GNUC__)

74# if __GNUC__ > 4

75# define GEOGRAPHICLIB_DEPRECATED(msg) __attribute__((deprecated(msg)))

76# else

77# define GEOGRAPHICLIB_DEPRECATED(msg) __attribute__((deprecated))

78# endif

79#elif defined(_MSC_VER) && _MSC_VER >= 1300

80# define GEOGRAPHICLIB_DEPRECATED(msg) __declspec(deprecated(msg))

81#else

82# define GEOGRAPHICLIB_DEPRECATED(msg)

83#endif

84

85#include

86#include

88

89

90

91

92

93

94

95

97

98

99

100

101

102

103

104

105

106

108 private:

110 Constants() = delete;

111

112 public:

113

114

115

117

118

119

121 { return Math::degree() / Math::dm; }

122

123

124

126 { return Math::degree() / Math::ds; }

127

128

129

130

131

132

133

134

135 template static T WGS84_a()

136 { return 6378137 * meter(); }

137

138

139

140

141 template static T WGS84_f() {

142

143

144

145 return 1 / ( T(298257223563LL) / 1000000000 );

146 }

147

148

149

150

151

152 template static T WGS84_GM()

153 { return T(3986004) * 100000000 + 41800000; }

154

155

156

157

158

160 { return 7292115 / (T(1000000) * 100000); }

161

162

163

164

165 template static T GRS80_a()

166 { return 6378137 * meter(); }

167

168

169

170

171

172 template static T GRS80_GM()

173 { return T(3986005) * 100000000; }

174

175

176

177

178

179

180

181

182

183

184

185

187 { return 7292115 / (T(1000000) * 100000); }

188

189

190

191

192

193 template static T GRS80_J2()

194 { return T(108263) / 100000000; }

195

196

197

198

199 template static T UTM_k0()

200 {return T(9996) / 10000; }

201

202

203

204

205 template static T UPS_k0()

206 { return T(994) / 1000; }

207

208

209

210

211

212

213

214

215

216

217

218

219 template static T meter() { return T(1); }

220

221

222

224 { return 1000 * meter(); }

225

226

227

228

230 { return 1852 * meter(); }

231

232

233

234

235

236

237

238

240 { return meter() * meter(); }

241

242

243

245 { return 10000 * square_meter(); }

246

247

248

250 { return kilometer() * kilometer(); }

251

252

253

255 { return nauticalmile() * nauticalmile(); }

256

257

258

259

260

261

262

263

265 { return real(254 * 12) / 10000 * meter(); }

266

267

268

270

271

272

274

275

276

278

279

280

282

283

284

286

287

288

290

291

292

294

295

296

297

298

299

300

301

303 { return real(1200) / 3937 * meter(); }

304

305 };

306

307

308

309

310

311

312

313

314

315

317 public:

318

319

320

321

322

323

324

326 };

327

328}

329

330#endif

#define GEOGRAPHICLIB_EXPORT

Definition Constants.hpp:67

GeographicLib::Math::real real

Header for GeographicLib::Math class.

Constants needed by GeographicLib

Definition Constants.hpp:107

static Math::real yard()

Definition Constants.hpp:269

static Math::real arcsecond()

Definition Constants.hpp:125

static Math::real square_kilometer()

Definition Constants.hpp:249

static Math::real degree()

Definition Constants.hpp:116

static T UPS_k0()

Definition Constants.hpp:205

static Math::real mile()

Definition Constants.hpp:285

static Math::real hectare()

Definition Constants.hpp:244

static Math::real kilometer()

Definition Constants.hpp:223

static Math::real fathom()

Definition Constants.hpp:273

static T GRS80_J2()

Definition Constants.hpp:193

static Math::real square_nauticalmile()

Definition Constants.hpp:254

static T GRS80_GM()

Definition Constants.hpp:172

static Math::real surveyfoot()

Definition Constants.hpp:302

static Math::real furlong()

Definition Constants.hpp:281

static Math::real arcminute()

Definition Constants.hpp:120

static T WGS84_omega()

Definition Constants.hpp:159

static T GRS80_a()

Definition Constants.hpp:165

static T GRS80_omega()

Definition Constants.hpp:186

static T UTM_k0()

Definition Constants.hpp:199

static Math::real square_mile()

Definition Constants.hpp:293

static T square_meter()

Definition Constants.hpp:239

static T meter()

Definition Constants.hpp:219

static Math::real chain()

Definition Constants.hpp:277

static Math::real foot()

Definition Constants.hpp:264

static T WGS84_f()

Definition Constants.hpp:141

static T WGS84_a()

Definition Constants.hpp:135

static Math::real acre()

Definition Constants.hpp:289

static T WGS84_GM()

Definition Constants.hpp:152

static Math::real nauticalmile()

Definition Constants.hpp:229

Exception handling for GeographicLib.

Definition Constants.hpp:316

GeographicErr(const std::string &msg)

Definition Constants.hpp:325

Namespace for GeographicLib.