# How to find the largest regular shape inside irregular convex polygons in 2D

I want to find a way that can find a regular or common shape (e.g a circle, triangle, square or rectangle) that has the maximum area inside different irregular 2D polygons.

From this article, it shows it is possible to find the largest circle of regular polygons. But it is not possible to find the largest circle of irregular polygons. I am wondering if there are any methods to find the largest regular shape inside irregular polygons?

If not, are there any good methods that can find a relatively large inside shape.

I thought a way of finding a relatively large inside shape.

#For one irregular polygon P centroid = calculate_the_centroid(P) for length in a range of incremental values: draw a inshape using the centroid and the length if inshape is inside the polygon: max_inshape = inshape continue else: break max_inshape is a relatively large inside shape 

However, this method can be computationally expensive and the performance is highly depended on setting the range of values. Any thoughts are welcome! Thank you guys very much.