diff options
author | David Thompson <dthompson2@worcester.edu> | 2014-05-27 21:30:57 -0400 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2014-05-27 21:30:57 -0400 |
commit | def69615603e49bb17b09c7352295578f9dd67af (patch) | |
tree | 873b5e22d8eba382617dafc8f282c7f7979dff92 | |
parent | aab9846635f8a5a4671684d382aecb23102bb3bc (diff) |
Add v= procedure.
* 2d/vector2.scm (v=): New procedure.
-rw-r--r-- | 2d/vector2.scm | 5 |
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) |