Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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?

share|improve this question
    
You mean circular sectors? –  J. M. Sep 8 '11 at 10:24
add comment

1 Answer

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.