From 908223915a494151e306cca6d9a9a6c2a2f1e429 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sun, 3 Aug 2014 20:35:22 -0400 Subject: Fix normalize procedure. * sly/vector.scm (normalize): Preserve dimensionality in the case where magnitude is 0. --- sly/vector.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)))) -- cgit v1.2.3