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

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--geometry/point2d.hpp7
-rw-r--r--std/complex.hpp1
2 files changed, 7 insertions, 1 deletions
diff --git a/geometry/point2d.hpp b/geometry/point2d.hpp
index 69b54278d0..2b071485ec 100644
--- a/geometry/point2d.hpp
+++ b/geometry/point2d.hpp
@@ -30,9 +30,14 @@ namespace m2
return ((fabs(x - p.x) < eps) && (fabs(y - p.y) < eps));
}
+ double SquareLength(m2::Point<T> const & p) const
+ {
+ return math::sqr(x - p.x) + math::sqr(y - p.y);
+ }
+
double Length(m2::Point<T> const & p) const
{
- return sqrt(math::sqr(x - p.x) + math::sqr(y - p.y));
+ return sqrt(SquareLength(p));
}
m2::Point<T> Move(T len, T ang) const
diff --git a/std/complex.hpp b/std/complex.hpp
index 3a13f0a5bd..da19ea0f9e 100644
--- a/std/complex.hpp
+++ b/std/complex.hpp
@@ -8,6 +8,7 @@
#include <complex>
using std::complex;
+using std::polar;
#ifdef DEBUG_NEW
#define new DEBUG_NEW