Fix integer overflow warning in line intersection calculation

Convert coordinates to float before arithmetic operations to prevent
overflow when multiplying large integer coordinate values.

Fixes RuntimeWarning: overflow encountered in scalar multiply
This commit is contained in:
Claude
2025-11-06 12:25:30 +00:00
parent af67184180
commit 29648c70e1
+4
View File
@@ -305,6 +305,10 @@ class FOVEstimatorNode:
(x1, y1), (x2, y2) = line1
(x3, y3), (x4, y4) = line2
# Convert to float to avoid integer overflow
x1, y1, x2, y2 = float(x1), float(y1), float(x2), float(y2)
x3, y3, x4, y4 = float(x3), float(y3), float(x4), float(y4)
denom = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4)
if abs(denom) < 1e-6: # Lines are parallel