Browse Source

diglib: increase numerical stability

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@71780 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 7 năm trước cách đây
mục cha
commit
0838296f6c
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      lib/vector/diglib/inside.c

+ 1 - 1
lib/vector/diglib/inside.c

@@ -26,7 +26,7 @@ dig_x_intersect(double beg_x,
     /* assumes beg_y != end_y */
     /* assumes beg_y != end_y */
 
 
     /* sort for numerical stability */
     /* sort for numerical stability */
-    if (end_y < beg_y) {
+    if (end_x < beg_x || (end_x == beg_x && end_y < beg_y)) {
 	b = end_x;
 	b = end_x;
 	end_x = beg_x;
 	end_x = beg_x;
 	beg_x = b;
 	beg_x = b;