From 5c89b3615c067c51e0076f5433ccbdbee5022f70 Mon Sep 17 00:00:00 2001 From: Sam Anthony Date: Wed, 2 Oct 2024 11:44:15 -0400 Subject: refactor --- geometry.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 geometry.cpp (limited to 'geometry.cpp') 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; +} -- cgit v1.2.3