summaryrefslogtreecommitdiffstats
path: root/source/Concept/Framework/tools.h
diff options
context:
space:
mode:
Diffstat (limited to 'source/Concept/Framework/tools.h')
-rw-r--r--source/Concept/Framework/tools.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/source/Concept/Framework/tools.h b/source/Concept/Framework/tools.h
index 6519a1b..0ca4dda 100644
--- a/source/Concept/Framework/tools.h
+++ b/source/Concept/Framework/tools.h
@@ -1,7 +1,8 @@
#ifndef _TOOLS_H
#define _TOOLS_H
-#include <stdlib.h>
+#include <stdlib.h>
+#include <math.h>
#ifndef new
void* operator new(size_t sz);
@@ -34,6 +35,11 @@ inline void usleep(int usec)
asm volatile("nop");
}
}
-};
+};
+
+inline float distance2d(float x1, float y1, float x2, float y2)
+{
+ return sqrt(((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2)));
+}
#endif