summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--2d/vector2.scm5
1 files changed, 5 insertions, 0 deletions
diff --git a/2d/vector2.scm b/2d/vector2.scm
index c6beb57..bc425a1 100644
--- a/2d/vector2.scm
+++ b/2d/vector2.scm
@@ -54,6 +54,11 @@
(vector2 (* r (cos theta))
(* r (sin theta))))
+(define (v= v1 v2)
+ "Return #t if V1 and V2 are equivalent, #f otherwise."
+ (and (= (vx v1) (vx v2))
+ (= (vy v1) (vy v2))))
+
(define (v+ . vectors)
"Return the sum of all VECTORS."
(define (add-vectors x y vectors)