diff options
author | sicarius <devnull@localhost> | 2007-02-18 01:14:00 +0100 |
---|---|---|
committer | sicarius <devnull@localhost> | 2007-02-18 01:14:00 +0100 |
commit | 3c3c628b617dc53f0b7b59285c7d67888074c33d (patch) | |
tree | 1d1848b37d14036542e7b704440f4eb4f4d8ef7b /source/Concept/Framework/tools.h | |
parent | 803027cbb45ebe01e4f8b427a7cc95728d6e5f47 (diff) | |
download | rc2007-soccer-3c3c628b617dc53f0b7b59285c7d67888074c33d.tar rc2007-soccer-3c3c628b617dc53f0b7b59285c7d67888074c33d.zip |
+++ Additional Codework
Diffstat (limited to 'source/Concept/Framework/tools.h')
-rw-r--r-- | source/Concept/Framework/tools.h | 10 |
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 |