summaryrefslogtreecommitdiffstats
path: root/geometry.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'geometry.cpp')
-rw-r--r--geometry.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/geometry.cpp b/geometry.cpp
new file mode 100644
index 0000000..ae2c8ae
--- /dev/null
+++ b/geometry.cpp
@@ -0,0 +1,17 @@
+#include "balls.h"
+
+Point
+ptAddVec(Point p, Vector v) {
+ p.x += v.x;
+ p.y += v.y;
+ return p;
+}
+
+Rectangle
+insetRect(Rectangle r, double n) {
+ r.min.x += n;
+ r.min.y += n;
+ r.max.x -= n;
+ r.max.y -= n;
+ return r;
+}