1
$\begingroup$

Is there algorithm that decide if two sectors intersect? I can transform the sector into polygons and use standard algorithms, but it has some cons. Any other ideas?

  • 0
    You mean circular sectors?2011-09-08

1 Answers 1

2

I'll assume you mean circular sectors. The sectors intersect if and only if either a) their boundaries intersect or b) one is a subset of the other.

For a), each boundary consists of a line segment and a circle segment. You can intersect each of the four pairs of the corresponding lines and circles and check whether any of the intersection points lie within the segments.

If not a), then either b) or the sectors are disjoint. So you just have to test both ways whether some point of one sector lies within the other -- this you can do by testing whether the point is inside the circle and on the appropriate side of the line.