Skip to content

Commit

Permalink
Update src/Sets/LineSegment/intersection.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
schillic authored Jul 31, 2024
1 parent 2714da3 commit 15c2658
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Sets/LineSegment/intersection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ function intersection(LS1::LineSegment, LS2::LineSegment)
# check that the line segments intersect
@inbounds begin
# box approximation
l, r = LS1.p[1] < LS1.q[1] ? (LS1.p[1], LS1.q[1]) : (LS1.q[1], LS1.p[1])
b, t = LS1.p[2] < LS1.q[2] ? (LS1.p[2], LS1.q[2]) : (LS1.q[2], LS1.p[2])
l, r = extrema((LS1.p[1], LS1.q[1]))
b, t = extrema((LS1.p[2], LS1.q[2]))
# check that the other line segment has at least one point inside the box
if !(l <= LS2.p[1] <= r && b <= LS2.p[2] <= t) &&
!(l <= LS2.q[1] <= r && b <= LS2.q[2] <= t)
Expand Down

0 comments on commit 15c2658

Please sign in to comment.