0
$\begingroup$

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!

  • 0
    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.2011-06-22

1 Answers 1

1

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.

  • 0
    For any others looking for how to determine if points are within a rectangle here's where I found the solution http://mathforum.org/library/drmath/view/54386.html2011-06-22