Пример #1
0
        public static Circle2 FitCircle(IList <Vector2> points)
        {
            var n = points.Count;

            if (n == 3)
            {
                return(Circle2.FromThreePoints(points[0], points[1], points[2]));
            }
            else
            {
                return(FitCircle(points, p => p.X, p => p.Y, p => 1)); // equal weights
            }
        }