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.
Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
Posted 17 March 2013 - 12:57 PM
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.
Posted 17 March 2013 - 01:10 PM
the center of the square would be at: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?
question2.png
Edited by SimonForsman, 17 March 2013 - 01:13 PM.
Posted 17 March 2013 - 01:28 PM
3 * PIThanks. What does 3PI means? Or is it just PI?
Posted 17 March 2013 - 02:03 PM
@OP : this is not just 3*Pi but 3*Pi/4 (so 3*Pi is needed)
Posted 17 March 2013 - 05:11 PM
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?
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: a^{2} + b^{2} = c^{2} . Well c^{2} is the diameter.. that much should be known.. and both sides will be equal. So a^{2} = b^{2}, making it sufficient to change the equation to 2a^{2} = c^{2}.. or basically side = sqrt(diameter^{2 }/ 2). Or in terms of the radius, side = sqrt(2r^{2})
Or as C0lumbo reduced it even further:
side = sqrt(2) * r
side = 1.414213 * r
Edited by Michael Tanczos, 17 March 2013 - 09:48 PM.
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
GameDev.net™, the GameDev.net logo, and GDNet™ are trademarks of GameDev.net, LLC.