# How to find the largest circle that fits inside a simple planar polygon?

Given a 2D simple polygon with $$n$$ vertices, how would I find the largest circle (whose centre and radius are unknown) that fits inside (circle can be tangent to edges/coincident with vertices) the polygon? Is there any way to solve this analytically as opposed to algorithmically?

• If by polygon you mean a regular polygon, then it will be it's in-circle. – John Paul Dec 5 '19 at 17:48
• @John Does regular imply that the polygon is 'convex'? If so, no...I deal with arbitrary polygons too. – niran90 Dec 5 '19 at 17:50
• @John Oh right, I just read the definition of regular. No, the polygon could have arbitrary lengths. – niran90 Dec 5 '19 at 17:51
• stackoverflow.com/questions/4279478/… might be worth a look. – Barry Cipra Dec 5 '19 at 18:37

I guess you could mix analytic and algorithmic. The maximiser circle will necessarily be constrained by three conditions which could be either "containing a vertex" or "being tangent to one of the edges". So you could iterate over each of the $$\binom {2n} 3$$ possible sets of three constraints, translate those into systems of equations, and solve them, throw out solutions that are not actually inscribed, and then maximise radius...
• It might also help to note that a vertex can be contained only when its internal angle exceeds $180^\circ$. – URL Dec 5 '19 at 18:36