Welcome to mirror list, hosted at ThFree Co, Russian Federation.

latlon.cpp « geometry - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 636a91c0541340b5cf3dea8346dccae6d3dcea32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "latlon.hpp"

#include "std/sstream.hpp"

namespace ms
{
// static
double const LatLon::kMinLat = -90;
double const LatLon::kMaxLat = 90;
double const LatLon::kMinLon = -180;
double const LatLon::kMaxLon = 180;

string DebugPrint(LatLon const & t)
{
  ostringstream out;
  out.precision(20);
  out << "ms::LatLon(" << t.lat << ", " << t.lon << ")";
  return out.str();
}

bool LatLon::operator == (ms::LatLon const & p) const
{
  return lat == p.lat && lon == p.lon;
}

bool LatLon::EqualDxDy(LatLon const & p, double eps) const
{
  return (my::AlmostEqualAbs(lat, p.lat, eps) && my::AlmostEqualAbs(lon, p.lon, eps));
}
}  // namespace ms