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?
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
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.