aboutsummaryrefslogtreecommitdiff
path: root/src/stm32/TODO/maths.h
diff options
context:
space:
mode:
authorFlenk008 <frenk_0_0@hotmail.com>2023-03-10 14:20:09 +0100
committerGitHub <noreply@github.com>2023-03-10 14:20:09 +0100
commit6bd3372103a97f8cb3183f1a7b0a3cfc3c1e1558 (patch)
tree16974fd4462defaf338aba06286992160e4e7246 /src/stm32/TODO/maths.h
parentad7a3609b650e4c1fccc7f2f768cfcb75a072b08 (diff)
parent4a740898621dcfc16fe257b6fe8695c768ec4dd6 (diff)
Merge branch 'lonkaars:dev' into dev
Diffstat (limited to 'src/stm32/TODO/maths.h')
-rw-r--r--src/stm32/TODO/maths.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/stm32/TODO/maths.h b/src/stm32/TODO/maths.h
new file mode 100644
index 0000000..0889c47
--- /dev/null
+++ b/src/stm32/TODO/maths.h
@@ -0,0 +1,16 @@
+#pragma once
+
+// #include <math.h>
+
+typedef struct {
+ u_int32_t x,y;
+} vec2;
+
+typedef vec2 vec_cen;//centered
+typedef vec2 vec_cor;//left upper corner
+
+#define HH_MATH_FIXED_POINT 7 //fixed point at decimal 7lsb (world positions in pixels (with fixed decimal point))
+
+#define MIN(a,b) (((a)<(b))?(a):(b))
+#define MAX(a,b) (((a)>(b))?(a):(b))
+#define CLAMP(N,LOWER,UPPER) (MIN(MAX(LOWER, N), UPPER))