diff options
author | David Thompson <dthompson2@worcester.edu> | 2014-08-03 20:35:22 -0400 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2014-08-25 19:33:07 -0400 |
commit | 908223915a494151e306cca6d9a9a6c2a2f1e429 (patch) | |
tree | 72fd212a76a16fb8cf6a4b05386053b792c2c55a | |
parent | e8f5b8cca92c41cd4a9a62c297ec01a38c786063 (diff) |
Fix normalize procedure.
* sly/vector.scm (normalize): Preserve dimensionality in the case where
magnitude is 0.
-rw-r--r-- | sly/vector.scm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sly/vector.scm b/sly/vector.scm index ecaad2a..a41176e 100644 --- a/sly/vector.scm +++ b/sly/vector.scm @@ -151,7 +151,7 @@ both be 3D vectors." "Normalize the vector V." (let ((m (magnitude v))) (if (zero? m) - 0 + v (vector-map (lambda (i n) (/ n m)) v)))) |