From: Scott Worley Date: Mon, 31 Dec 2012 07:04:58 +0000 (-0800) Subject: Increase the skip-rotation epsilon X-Git-Url: http://git.scottworley.com/nt3d/commitdiff_plain/08b46dbddc6defd45926a69631e3a09ea2273e45 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. --- 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; }