@@ -857,19 +857,19 @@ inline bool segments_intersect(const double &x1,
857
857
(fmin (x3, x4) <= fmin (x1, x2) && fmin (x1, x2) <= fmax (x3, x4));
858
858
}
859
859
}
860
-
860
+
861
861
return false ;
862
862
}
863
863
864
- double n1 = ((x4 - x3) * (y1 - y3)) - ((y4 - y3) * (x1 - x3));
865
- double n2 = ((x2 - x1) * (y1 - y3)) - ((y2 - y1) * (x1 - x3));
864
+ const double n1 = ((x4 - x3) * (y1 - y3)) - ((y4 - y3) * (x1 - x3));
865
+ const double n2 = ((x2 - x1) * (y1 - y3)) - ((y2 - y1) * (x1 - x3));
866
866
867
- double u1 = n1 / den;
868
- double u2 = n2 / den;
867
+ const double u1 = n1 / den;
868
+ const double u2 = n2 / den;
869
869
870
- return ((u1 > 0.0 || isclose (u1, 0.0 , rtol, atol)) &&
871
- (u1 < 1.0 || isclose (u1, 1.0 , rtol, atol)) &&
872
- (u2 > 0.0 || isclose (u2, 0.0 , rtol, atol)) &&
870
+ return ((u1 > 0.0 || isclose (u1, 0.0 , rtol, atol)) &&
871
+ (u1 < 1.0 || isclose (u1, 1.0 , rtol, atol)) &&
872
+ (u2 > 0.0 || isclose (u2, 0.0 , rtol, atol)) &&
873
873
(u2 < 1.0 || isclose (u2, 1.0 , rtol, atol)));
874
874
}
875
875
0 commit comments