Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Need some math help...

Need some math help...

Scheduled Pinned Locked Moved The Lounge
helptutorial
7 Posts 7 Posters 8 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    Ivor S Sargoytchev
    wrote on last edited by
    #1

    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).

    N C S L 4 Replies Last reply
    0
    • I Ivor S Sargoytchev

      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).

      N Offline
      N Offline
      Nish Nishant
      wrote on last edited by
      #2

      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!

      M 1 Reply Last reply
      0
      • N Nish Nishant

        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!

        M Offline
        M Offline
        Marc Clifton
        wrote on last edited by
        #3

        Nishant Sivakumar wrote:

        Perhaps someone couldn't differentiate between math and coding!

        Or homework. Marc Pensieve

        1 Reply Last reply
        0
        • I Ivor S Sargoytchev

          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).

          C Offline
          C Offline
          code frog 0
          wrote on last edited by
          #4

          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 --

          E 1 Reply Last reply
          0
          • I Ivor S Sargoytchev

            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).

            S Offline
            S Offline
            Shog9 0
            wrote on last edited by
            #5

            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

            1 Reply Last reply
            0
            • I Ivor S Sargoytchev

              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).

              L Offline
              L Offline
              leppie
              wrote on last edited by
              #6

              http://mathworld.wolfram.com/Incircle.html[^] maybe? But it's only for triangles...

              xacc.ide-0.1.2.12
              Now with more features and one less bug!

              1 Reply Last reply
              0
              • C code frog 0

                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 --

                E Offline
                E Offline
                El Corazon
                wrote on last edited by
                #7

                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)

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups