summaryrefslogtreecommitdiff
path: root/maths.h
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2024-06-30 18:24:01 +1000
committerquou <quou@disroot.org>2024-06-30 18:27:11 +1000
commit39100e7292d3ee12d387fddfa0f0d7b712e31e1c (patch)
tree28f26b19de857868aeb9ecf23a7fecfc170addf9 /maths.h
initial commit.
Diffstat (limited to 'maths.h')
-rw-r--r--maths.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/maths.h b/maths.h
new file mode 100644
index 0000000..92861ba
--- /dev/null
+++ b/maths.h
@@ -0,0 +1,17 @@
+#ifndef maths_h
+#define maths_h
+
+#define mini(a_, b_) ((a_) < (b_) ? (a_) : (b_))
+#define maxi(a_, b_) ((a_) > (b_) ? (a_) : (b_))
+#define clamp(v_, min_, max_) (maxi(min_, mini(max_, v_)))
+
+#define fbits 9
+
+int absolute(int x);
+int fsin(int t);
+int fcos(int t);
+int ftan(int t);
+int flerp(int a, int b, int t);
+int fsqrt(int v);
+
+#endif