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.

I've seen many examples of checking for a rectangle (A) intersecting another rectangle (B), but I'm developing something where I need to check if A is bisecting (crossing outside of) B.

My intersect method returns true if A is completely inside of B and also true if it bisects B. I'd like it to return false if A is completely inside of B.

Note: A and B could have rotation applied.

thanks!

share|improve this question
2  
bisect usually means "cut in half" –  Henry Jun 22 '11 at 18:01
    
True, I wasn't sure the technical term for crossing over or overlapping. In everyday usage you can say a road bisects another without the latter ending up in two equal parts. –  kreek Jun 22 '11 at 18:20

1 Answer 1

up vote 1 down vote accepted

You can check whether A is completely inside B by checking if each of the four corners of A is inside B; if so then return false to your original question.

share|improve this answer
    
For any others looking for how to determine if points are within a rectangle here's where I found the solution mathforum.org/library/drmath/view/54386.html –  kreek Jun 22 '11 at 20:02

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.