From ea46405cd91cb0f1cef7dc5e57851bcd3b3cd5b7 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Sat, 15 Jun 2013 03:47:58 +0100 Subject: [PATCH] tweak delauny code to be more strict on it's colinear detection --- external/delaunay.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/external/delaunay.js b/external/delaunay.js index c4533930..e9ec5b4b 100644 --- a/external/delaunay.js +++ b/external/delaunay.js @@ -18,7 +18,7 @@ /* If the points of the triangle are collinear, then just find the * extremes and use the midpoint as the center of the circumcircle. */ - if(Math.abs(G) < 0.000001) { + if(Math.abs(G) < 1e-12) { minx = Math.min(a.x, b.x, c.x) miny = Math.min(a.y, b.y, c.y) dx = (Math.max(a.x, b.x, c.x) - minx) * 0.5 @@ -166,4 +166,4 @@ /* Yay, we're done! */ return closed - } \ No newline at end of file + }