10#if !defined(GEOGRAPHICLIB_DMS_HPP)
11#define GEOGRAPHICLIB_DMS_HPP 1
88 static void replace(std::string& s,
const std::string& pat,
char c);
89 static const char*
const hemispheres_;
90 static const char*
const signs_;
91 static const char*
const digits_;
92 static const char*
const dmsindicators_;
93 static const char*
const components_[3];
94 static Math::real NumMatch(
const std::string& s);
95 static Math::real InternalDecode(
const std::string& dmsa, flag& ind);
230 static Math::real Decode(
const std::string& dms, flag& ind);
245 {
return d + (m + s /
real(Math::ms)) /
real(Math::dm); }
270 static void DecodeLatLon(
const std::string& dmsa,
const std::string& dmsb,
272 bool longfirst =
false);
285 static Math::real DecodeAngle(
const std::string& angstr);
299 static Math::real DecodeAzimuth(
const std::string& azistr);
329 static std::string Encode(
real angle, component trailing,
unsigned prec,
330 flag ind = NONE,
char dmssep =
char(0));
350 static std::string
Encode(real angle,
unsigned prec,
flag ind = NONE,
351 char dmssep =
char(0)) {
352 return ind == NUMBER ? Utility::str(angle,
int(prec)) :
354 prec < 2 ? DEGREE : (prec < 4 ? MINUTE : SECOND),
355 prec < 2 ? prec : (prec < 4 ? prec - 2 : prec - 4),
366 static void Encode(real ang, real& d, real& m) {
367 d = int(ang); m =
real(Math::dm) * (ang - d);
378 static void Encode(real ang, real& d, real& m, real& s) {
379 d = int(ang); ang =
real(Math::dm) * (ang - d);
380 m = int(ang); s =
real(Math::ms) * (ang - m);
Header for GeographicLib::Constants class.
#define GEOGRAPHICLIB_EXPORT
GeographicLib::Math::real real
Header for GeographicLib::Utility class.
Convert between degrees and the DMS representation.
static void Encode(real ang, real &d, real &m)
static Math::real Decode(real d, real m=0, real s=0)
static std::string Encode(real angle, unsigned prec, flag ind=NONE, char dmssep=char(0))
static void Encode(real ang, real &d, real &m, real &s)
Namespace for GeographicLib.