Skip to content

Commit d240f60

Browse files
committed
Handle extreme sizes better, use max f32 value for line segment in is_point_in_polygon
1 parent d93367c commit d240f60

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/geometry.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ pub fn is_point_in_polygon(x: f32, y: f32, polygon: Vec<(f32, f32)>) -> bool {
112112

113113
// Create a point for line segment
114114
// from p to infinite
115-
let extreme = (10000.0, p.1);
115+
let extreme = (f32::MAX, p.1);
116116

117117
// To count number of points in polygon
118118
// whose y-coordinate is equal to

0 commit comments

Comments
 (0)