summaryrefslogtreecommitdiffstats
path: root/source/Concept/Framework/tools.h
diff options
context:
space:
mode:
authorsicarius <devnull@localhost>2007-02-18 18:57:03 +0100
committersicarius <devnull@localhost>2007-02-18 18:57:03 +0100
commitda9860f9a414d8ab403496ac74a51afc5ad3e48b (patch)
tree8ee187417943c799e409cb8ddd201828d16ab7b6 /source/Concept/Framework/tools.h
parent3c3c628b617dc53f0b7b59285c7d67888074c33d (diff)
downloadrc2007-soccer-da9860f9a414d8ab403496ac74a51afc5ad3e48b.tar
rc2007-soccer-da9860f9a414d8ab403496ac74a51afc5ad3e48b.zip
+++ Additional Codework
Diffstat (limited to 'source/Concept/Framework/tools.h')
-rw-r--r--source/Concept/Framework/tools.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/Concept/Framework/tools.h b/source/Concept/Framework/tools.h
index 0ca4dda..ca19993 100644
--- a/source/Concept/Framework/tools.h
+++ b/source/Concept/Framework/tools.h
@@ -9,6 +9,10 @@
void operator delete(void* p);
#endif
+#define max(a, b) (((a) > (b)) ? (a) : (b))
+#define min(a, b) (((a) < (b)) ? (a) : (b))
+#define sign(a) (((a) < 0) ? (-1) : (1))
+
inline void sleep(int sec)
{
for (int s=0; s<sec; s++) {
@@ -40,6 +44,11 @@ inline void usleep(int usec)
inline float distance2d(float x1, float y1, float x2, float y2)
{
return sqrt(((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2)));
+}
+
+inline float direction2d(float x1, float y1, float x2, float y2)
+{
+ return atan((y2 - y1) / (x2 - x1));
}
#endif