Skip to content

Commit

Permalink
simplify nonzero check
Browse files Browse the repository at this point in the history
  • Loading branch information
schillic committed Feb 28, 2018
1 parent 5cb27e4 commit c9a0f34
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/LineSegment.jl
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ The algorithm is inspired from [here](https://stackoverflow.com/a/328110).
function (x::AbstractVector{N}, L::LineSegment{N})::Bool where {N<:Real}
@assert length(x) == dim(L)
# check if the point is on the line through the line segment
if abs((x[2] - L.p[2]) * (L.q[1] - L.p[1]) -
(x[1] - L.p[1]) * (L.q[2] - L.p[2])) > 0
if (x[2] - L.p[2]) * (L.q[1] - L.p[1]) -
(x[1] - L.p[1]) * (L.q[2] - L.p[2]) != 0
return false
end
# check if the point is inside the box approximation of the line segment
Expand Down

0 comments on commit c9a0f34

Please sign in to comment.