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:
Diffstat (limited to 'base/math.hpp')
-rw-r--r--base/math.hpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/base/math.hpp b/base/math.hpp
index c54f74843c..01c31a0c43 100644
--- a/base/math.hpp
+++ b/base/math.hpp
@@ -11,10 +11,18 @@
#include <boost/integer.hpp>
+namespace math
+{
+ double constexpr pi = 3.14159265358979323846;
+ double constexpr pi2 = pi / 2.;
+ double constexpr pi4 = pi / 4.;
+ double constexpr twicePi = 2. * pi;
+
+ template <class T> T sqr(T t) { return (t*t); }
+}
namespace my
{
-
template <typename T> inline T Abs(T x)
{
return (x < 0 ? -x : x);