summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'util.c')
-rw-r--r--util.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/util.c b/util.c
index e7a9544..babaaf4 100644
--- a/util.c
+++ b/util.c
@@ -8,6 +8,24 @@
#include "graphics.h"
#include "internal.h"
+Point
+minpt(Point a, Point b)
+{
+ return (Point){
+ min(a.x, b.x),
+ min(a.y, b.y)
+ };
+}
+
+Point
+maxpt(Point a, Point b)
+{
+ return (Point){
+ max(a.x, b.x),
+ max(a.y, b.y)
+ };
+}
+
Point2
modulapt2(Point2 a, Point2 b)
{