My Math Forum Test the intersection of a rectangle and a circle

 Algebra Pre-Algebra and Basic Algebra Math Forum

 October 24th, 2011, 06:18 AM #1 Newbie   Joined: Oct 2011 Posts: 6 Thanks: 0 Test the intersection of a rectangle and a circle Hello, I need to test whether a rectangle and a circle intersect in a 2D graph. I am given the upper-left and lower-right vertices of the rectangle and the radius and center point coordinates of the circle. Graphically that would be easy but is there any formula to check that? Thanks in advance!
October 24th, 2011, 07:08 AM   #2
Math Team

Joined: Dec 2006
From: Lexington, MA

Posts: 3,267
Thanks: 408

Re: Test the intersection of a rectangle and a circle

Hello, andirrashi!

Quote:
 I need to test whether a rectangle and a circle intersect in a 2D graph. I am given the upper-left and lower-right vertices of the rectangle and the radius and center point coordinates of the circle. Graphically that would be easy, but is there any formula to check that?

I assume that the sides of the rectangle are parallel to the coordinate axes.

$\text{Suppose the given vertices are: }\:A(x_1,\,y_1)\,\text{ and }\,C(x_2,\,y_2)$

[color=beige]. . [/color]$\text{Then the other two vertices are: }\:B(x_2,\,y_1)\,\text{ and }\,D(x_1,\,y_2)$

$\text{Suppose the circle has center }O(x_3,\,y_3)\,\text{ and \,radius }R.$

$\text{Find the distances: }\:\overline{OA},\:\overline{OB},\:\overline{OC},\ :\overline{OD}$
[color=beige]. . [/color]$\text{to see if any of them is }\le\,R.$

 October 24th, 2011, 07:36 AM #3 Newbie   Joined: Oct 2011 Posts: 6 Thanks: 0 Re: Test the intersection of a rectangle and a circle Thanks for reply Soroban, much appreciated,, Your assumption is correct, I'm sorry to not mention that they are aligned parallel to the x and y axis, but what if the situation is like this: [img] http://imageshack.us/photo/my-images/8/rectl.jpg [/img]
 October 24th, 2011, 07:38 AM #4 Newbie   Joined: Oct 2011 Posts: 6 Thanks: 0 Re: Test the intersection of a rectangle and a circle In the above case distance OA or OB is clearly bigger than R ...

 Tags circle, intersection, rectangle, test

,

,

### arc intersection rect

Click on a term to search for related topics.
 Thread Tools Display Modes Linear Mode

 Similar Threads Thread Thread Starter Forum Replies Last Post Andromedus Algebra 18 February 3rd, 2012 12:03 PM mhurkman Algebra 4 February 7th, 2011 10:40 AM nom Algebra 1 August 15th, 2010 03:08 AM horees Algebra 2 December 18th, 2009 12:51 PM Oxymoron Algebra 4 July 23rd, 2008 04:11 PM

 Contact - Home - Forums - Cryptocurrency Forum - Top