implementation of GetRadius for arbitrary polygons