summaryrefslogtreecommitdiff
path: root/app/bin/bdf2xtp.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2018-03-19 19:55:58 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2018-03-19 19:55:58 +0100
commitd1a8285f818eb7e5c3d6a05709ea21a808490b8c (patch)
tree326578f0505cbed07cfe60de530022822dc237ac /app/bin/bdf2xtp.c
parent16e9630b79f0a7a90c6cedb6781175bb8b337dc1 (diff)
New upstream version 5.1.0upstream/5.1.0
Diffstat (limited to 'app/bin/bdf2xtp.c')
-rw-r--r--app/bin/bdf2xtp.c10
1 files changed, 3 insertions, 7 deletions
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 <v> 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 ));
}