Need some math help...
-
I have a closed polygon, I need to find the center of the largest circle that can fit inside it. The polygon can be any shape (like an ameba or a crescent for example).
-
I have a closed polygon, I need to find the center of the largest circle that can fit inside it. The polygon can be any shape (like an ameba or a crescent for example).
Chris usually answers all the math stuff in here - when he gets some free time :-) I also don't understand why you were voted a 1. Perhaps someone couldn't differentiate between math and coding! Regards, Nish
Nish’s thoughts on MFC, C++/CLI and .NET (my blog)
The Ultimate Grid - The #1 MFC grid out there! -
Chris usually answers all the math stuff in here - when he gets some free time :-) I also don't understand why you were voted a 1. Perhaps someone couldn't differentiate between math and coding! Regards, Nish
Nish’s thoughts on MFC, C++/CLI and .NET (my blog)
The Ultimate Grid - The #1 MFC grid out there!Nishant Sivakumar wrote:
Perhaps someone couldn't differentiate between math and coding!
Or homework. Marc Pensieve
-
I have a closed polygon, I need to find the center of the largest circle that can fit inside it. The polygon can be any shape (like an ameba or a crescent for example).
Oddly enough I think this was a school problem for me at one point in time or another. I googled for "inscribed circle in polygon" and got some pretty good hits. Here is one:http://www.mathwords.com/i/inscribed_circle.htm[^] Me thinks that this will only work on regular polygons which then makes it trivial. If you want to use irregular polygons you break the classical defenition in that each edge of the polygon cannot be tangent to the circle. In that case I think you first put the polygon inside a circle so that as many points of the polygon as possible are on the circumference of the circle then you use the center of the circle as your basis for calculating/discovering where your polygons center would be. I think you have to stick it inside a circle first though but it's been a long time since I actually did it. - Rex
I only read CP for the articles. Code-frog System Architects, Inc.
Modified on: Wednesday, February 15, 2006 2:40:30 PM --
-
I have a closed polygon, I need to find the center of the largest circle that can fit inside it. The polygon can be any shape (like an ameba or a crescent for example).
I'd break it down into a collection of (potentially overlapping) regular polygons, pick the biggest one, and find the center.
---- Scripts i've known... CPhog 0.9.9 - make CP better. Forum Bookmark 0.2.5 - bookmark forum posts on Pensieve Print forum 0.1.1 - printer-friendly forums
-
I have a closed polygon, I need to find the center of the largest circle that can fit inside it. The polygon can be any shape (like an ameba or a crescent for example).
http://mathworld.wolfram.com/Incircle.html[^] maybe? But it's only for triangles...
-
Oddly enough I think this was a school problem for me at one point in time or another. I googled for "inscribed circle in polygon" and got some pretty good hits. Here is one:http://www.mathwords.com/i/inscribed_circle.htm[^] Me thinks that this will only work on regular polygons which then makes it trivial. If you want to use irregular polygons you break the classical defenition in that each edge of the polygon cannot be tangent to the circle. In that case I think you first put the polygon inside a circle so that as many points of the polygon as possible are on the circumference of the circle then you use the center of the circle as your basis for calculating/discovering where your polygons center would be. I think you have to stick it inside a circle first though but it's been a long time since I actually did it. - Rex
I only read CP for the articles. Code-frog System Architects, Inc.
Modified on: Wednesday, February 15, 2006 2:40:30 PM --
code-frog wrote:
I think this was a school problem for me at one point in time or another.
So did I... the instructor hated my solution. Under "show work" section next to the problem, I wrote the program I used to try a binary search from center to largets circle (two farthest points) until you determined which was the correct size. I always did prefer programming over math. Which I think is why I was cursed with my current job. ;) _________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)