Skip to content

Commit e8c3ef8

Browse files
author
Luke Stagner
committed
Fix failure if d and un are negative
1 parent f71d549 commit e8c3ef8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/concave_hull.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function intersect_line{T<:AbstractVector,S<:AbstractVector}(ls1::NTuple{2,T},ls
99
d = cross2d(r,s)
1010
un = cross2d(qmp,r)
1111
d == 0.0 && (return un == 0.0)
12-
return (0 < un < d) && (0 < cross2d(qmp, s) < d)
12+
return (0 < un/d < 1) && (0 < cross2d(qmp, s)/d < 1)
1313
end
1414

1515
function get_angle(p_pro,p_cur,p_pre)

0 commit comments

Comments
 (0)