Sign in to follow this  
P0jahn

Largest square that fit inside a circle

Recommended Posts

P0jahn    307

I have a circle. The only known information I have about this circle is the radius.

I want to calculate the width/height of the largest square that fits inside this circle.

Share this post


Link to post
Share on other sites
C0lumbo    4411

I think the answer is that the side of the squares are (radius * root2) = 1.414213 * radius.

 

I suck at showing working, but the trick was to imagine the right-angled triangle made where the radius at 45-degrees is the hypotenuse, and the other two sides represent half the square edge length.

Share this post


Link to post
Share on other sites
P0jahn    307

Thanks for the help.

Although I have to apologize for not understanding your anwser.

 

I have a 2nd question that is related to this:
How do I calculate the position of the unknown position?

[attachment=14316:question2.png]

Edited by P0jahn

Share this post


Link to post
Share on other sites
SimonForsman    7642

Thanks for the help.
Although I have to apologize for not understanding your anwser.
 
I have a 2nd question that is related to this:
How do I calculate the position of the unknown position?
attachicon.gifquestion2.png

the center of the square would be at:
cx = 200+radius
yy = 120-radius

your unknown corner is then located at:

ux = cx + cos(3PI/4) * radius
uy = cy + sin(3PI/4) * radius

http://www.mathsisfun.com/geometry/images/circle-unit-radians.gif

The length of the side of the square is 2 * cos(3PI/4) * radius Edited by SimonForsman

Share this post


Link to post
Share on other sites
Michael Tanczos    5681

Thanks for the help.

Although I have to apologize for not understanding your anwser.

 

I have a 2nd question that is related to this:
How do I calculate the position of the unknown position?

attachicon.gifquestion2.png

 

You need to take the square you want to create and split it into two triangles along the diagonal.   This diagonal would be the same as the diameter of the circle.  To figure out the sides you just need the quadratic equation: a2 + b2 = c2 .    Well c2 is the diameter.. that much should be known.. and both sides will be equal.  So a2 = b2, making it sufficient to change the equation to 2a2 = c2.. or basically side = sqrt(diameter2 / 2).  Or in terms of the radius, side = sqrt(2r2)

 

Or as C0lumbo reduced it even further:

side = sqrt(2) * r

side = 1.414213 * r

Edited by Michael Tanczos

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this