From 08b46dbddc6defd45926a69631e3a09ea2273e45 Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Sun, 30 Dec 2012 23:04:58 -0800 Subject: [PATCH] Increase the skip-rotation epsilon Observed: a 0.9999999999999999 dot product yields a 1.4901161193847656e-8 angle. The new, larger epsilon skips rotation for this point. --- nt3d.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nt3d.js b/nt3d.js index 0389946..7198e22 100644 --- a/nt3d.js +++ b/nt3d.js @@ -288,8 +288,8 @@ nt3d = { // by crossing a and b to get a rotation axis and using // angle_between to get a rotation angle. var angle = this.angle_between(this.unit(a), this.unit(b)); - if (Math.abs(angle) < 1e-15) { - // No siginificant rotation to perform. Bail to avoid + if (Math.abs(angle) < 1e-7) { + // No significant rotation to perform. Bail to avoid // NaNs and numerical error return points; } -- 2.44.1