#### Archived

This topic is now archived and is closed to further replies.

# intersection between circle and rectangle

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

## Recommended Posts

Hello everyone, Given a circle of radius r and a quad (x0,y0) ( x1,y1) (x2, y2) (x3, y3) what would be the fastest way of determining if they intersect? I have figured out a way using the distance from a line example in the comp.graphics.algorithms faq but it seems rather convoluted. This is basically to provide collision detection in a 2D enviroment for a ball hitting a quad which can be rotated through any angle. Any help would be appreciated. Thankyou for your time.

##### Share on other sites
Briefly.
do a point in rectangle test. but rather than checking if the center of the circle is exactly in the reactangle, check if it is radius away from it.

1. 1
Rutin
40
2. 2
3. 3
4. 4
5. 5

• 9
• 21
• 20
• 14
• 14
• ### Forum Statistics

• Total Topics
633383
• Total Posts
3011584
• ### Who's Online (See full list)

There are no registered users currently online

×