public bool IsCircle(List <IntPoint> edgePoints, out Point center, out float radius)
{
if (edgePoints.Count < 8)
{
center = new Point(0f, 0f);
radius = 0f;
return(false);
}
PointsCloud.GetBoundingRectangle(edgePoints, out IntPoint minXY, out IntPoint maxXY);
IntPoint point = maxXY - minXY;
center = minXY + (Point)point / 2f;
radius = ((float)point.X + (float)point.Y) / 4f;
float num = 0f;
int i = 0;
for (int count = edgePoints.Count; i < count; i++)
{
num += System.Math.Abs(center.DistanceTo(edgePoints[i]) - radius);
}
num /= (float)edgePoints.Count;
float num2 = System.Math.Max(minAcceptableDistortion, ((float)point.X + (float)point.Y) / 2f * relativeDistortionLimit);
return(num <= num2);
}