summaryrefslogtreecommitdiff
path: root/2d
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2014-05-27 21:30:57 -0400
committerDavid Thompson <dthompson2@worcester.edu>2014-05-27 21:30:57 -0400
commitdef69615603e49bb17b09c7352295578f9dd67af (patch)
tree873b5e22d8eba382617dafc8f282c7f7979dff92 /2d
parentaab9846635f8a5a4671684d382aecb23102bb3bc (diff)
Add v= procedure.
* 2d/vector2.scm (v=): New procedure.
Diffstat (limited to '2d')
-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)