• Advertisement
Sign in to follow this  

Square/Circle Overlap test

This topic is 2682 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Break the square into line segments. Check if each line segment intersects the circle if not then circle is inside if so then circle isn't inside(given what you already have ).

Share this post


Link to post
Share on other sites
Quote:
Original post by stonemetal
Break the square into line segments. Check if each line segment intersects the circle if not then circle is inside if so then circle isn't inside(given what you already have ).
Although you can do it this way, it shouldn't be necessary to perform per-edge tests, I don't think. You should be able to simply perform a point containment test using a square that's been 'shrunk' by the circle radius. (IINM.)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement