diff options
author | Arsentiy Milchakov <milcars@mapswithme.com> | 2019-04-15 18:28:54 +0300 |
---|---|---|
committer | Tatiana Yan <tatiana.kondakova@gmail.com> | 2019-04-22 18:47:33 +0300 |
commit | 01c771fe7f945a53581a7badb0a6b840e98f572a (patch) | |
tree | a747713bde42905d1d99698a9fb59b2e7ccb2c21 /geometry | |
parent | 2397d5d659b53cd7d7f4787ba6ae5e24189302f2 (diff) |
[booking][search] booking filter improvement. review fixes
Diffstat (limited to 'geometry')
-rw-r--r-- | geometry/mercator.cpp | 6 | ||||
-rw-r--r-- | geometry/mercator.hpp | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/geometry/mercator.cpp b/geometry/mercator.cpp index 3ba242c644..f1a9e46258 100644 --- a/geometry/mercator.cpp +++ b/geometry/mercator.cpp @@ -50,3 +50,9 @@ double MercatorBounds::AreaOnEarth(m2::PointD const & p1, m2::PointD const & p2, { return ms::AreaOnEarth(ToLatLon(p1), ToLatLon(p2), ToLatLon(p3)); } + +double MercatorBounds::AreaOnEarth(m2::RectD const & rect) +{ + return MercatorBounds::AreaOnEarth(rect.LeftTop(), rect.LeftBottom(), rect.RightBottom()) + + MercatorBounds::AreaOnEarth(rect.LeftTop(), rect.RightTop(), rect.RightBottom()); +} diff --git a/geometry/mercator.hpp b/geometry/mercator.hpp index 81ccdad485..a503dff617 100644 --- a/geometry/mercator.hpp +++ b/geometry/mercator.hpp @@ -118,4 +118,6 @@ struct MercatorBounds /// Calculates area of a triangle on Earth in m² by three mercator points. static double AreaOnEarth(m2::PointD const & p1, m2::PointD const & p2, m2::PointD const & p3); + /// Calculates area on Earth in m². + static double AreaOnEarth(m2::RectD const & mercatorRect); }; |