From d1a8285f818eb7e5c3d6a05709ea21a808490b8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Mon, 19 Mar 2018 19:55:58 +0100 Subject: New upstream version 5.1.0 --- app/bin/bdf2xtp.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'app/bin/bdf2xtp.c') diff --git a/app/bin/bdf2xtp.c b/app/bin/bdf2xtp.c index adc2b04..76fb31a 100644 --- a/app/bin/bdf2xtp.c +++ b/app/bin/bdf2xtp.c @@ -134,21 +134,17 @@ double findDistance( coOrd p0, coOrd p1 ) int small(double v ) /* is close to 0.0 */ { - return (fabs(v) < 0.0001); + return (fabs(v) < 0.000000000001); } double findAngle( coOrd p0, coOrd p1 ) /* find angle between two points */ { double dx = p1.x-p0.x, dy = p1.y-p0.y; - if (small(dx)) { - if (dy >=0) return 0.0; + if (small(dx) && small(dy)) { + if (dy >=0.0) return 0.0; else return 180.0; } - if (small(dy)) { - if (dx >=0) return 90.0; - else return 270.0; - } return R2D(atan2( dx,dy )); } -- cgit v1.2.3