Square method generalized to Polygon