I need an algorithm that, given an array of points representing a polygon (which is usually a rectangle-ish shape, but could be any nonregular polygon), and given a point click location within that polygon, fit a circle touching the three sides of the polygon that are closest to the clicked location, but maximizing the overall coverage of the circle without leaving the boundary
It's easy to do touching two sides (find centroid, then find shortest distance to edge, etc) - but touching three sides is the challenge. See the attached hand drawing.
I need answer soon..Thanks!