]> git.scottworley.com Git - nt3d/blobdiff - nt3d.js
Fix a bug in project()
[nt3d] / nt3d.js
diff --git a/nt3d.js b/nt3d.js
index c69c185362a1411aa0ebfa604699f951a194c338..fd57824388105fcb27341886c2eea12261f44813 100644 (file)
--- a/nt3d.js
+++ b/nt3d.js
@@ -211,7 +211,7 @@ nt3d = {
        },
        project: function(a, b) { // Project b onto a
                var a_magnitude = this.magnitude(a);
-               return this.scale(a, this.dot(a, b) / a_magnitude * a_magnitude);
+               return this.scale(a, this.dot(a, b) / (a_magnitude * a_magnitude));
        },
        project_to_orthogonal: function(a, b) {
                // The nearest thing to b that is orthogonal to a