diff options
author | David Thompson <dthompson2@worcester.edu> | 2018-12-09 14:44:59 -0500 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2018-12-09 14:44:59 -0500 |
commit | bca534837b1ec406f1152f93b21c7206606d205c (patch) | |
tree | 8b56087e0077be0c78e0b544c69c3a77f6917067 | |
parent | 5dbd832c3ce65ff29232b4f4642e3d713bb1a7ec (diff) |
math: grid: Simplify a formula.
* chickadee/math/grid.scm (slide): Simplify formula for setting new
goal coordinates.
-rw-r--r-- | chickadee/math/grid.scm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/chickadee/math/grid.scm b/chickadee/math/grid.scm index 9982f90..3a2f83f 100644 --- a/chickadee/math/grid.scm +++ b/chickadee/math/grid.scm @@ -66,10 +66,10 @@ needed to make the rectangles no longer overlap." (if (< x-fix y-fix) (if (= goal-x x1) (set-vec2-x! goal (+ (vec2-x goal) x-fix)) - (set-vec2-x! goal (+ (vec2-x goal) (- x-fix)))) + (set-vec2-x! goal (- (vec2-x goal) x-fix))) (if (= goal-y y1) (set-vec2-y! goal (+ (vec2-y goal) y-fix)) - (set-vec2-y! goal (+ (vec2-y goal) (- y-fix))))))) + (set-vec2-y! goal (- (vec2-y goal) y-fix)))))) ;;; |