From: ellson Date: Tue, 3 Oct 2006 19:15:51 +0000 (+0000) Subject: fix an arithmetic instability X-Git-Tag: LAST_LIBGRAPH~32^2~5841 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=490486ad67099780b43962d226e08a733caffd78;p=graphviz fix an arithmetic instability --- diff --git a/lib/common/geom.c b/lib/common/geom.c index 852f7f227..0c4bb3b05 100644 --- a/lib/common/geom.c +++ b/lib/common/geom.c @@ -527,5 +527,6 @@ double ptToLine2 (pointf a, pointf b, pointf p) double dx = b.x-a.x; double dy = b.y-a.y; double a2 = (p.y-a.y)*dx - (p.x-a.x)*dy; + if (a2 < .00001) return 0.; return (a2*a2) / (dx*dx + dy*dy); }