예제 #1
0
        public static Circle2 CreateFromPointsAAB(IList <Vector2> points)
        {
            if (points.Count == 0)
            {
                return(default(Circle2));
            }
            Vector2 center;
            Vector2 vector;

            AAB2.CreateFromPoints(points).CalcCenterExtents(out center, out vector);
            Circle2 result;

            result.Center = center;
            result.Radius = vector.magnitude;
            return(result);
        }
예제 #2
0
        public static Circle2 CreateFromPointsAAB(IEnumerable <Vector2> points)
        {
            IEnumerator <Vector2> enumerator = points.GetEnumerator();

            enumerator.Reset();
            if (!enumerator.MoveNext())
            {
                return(default(Circle2));
            }
            Vector2 center;
            Vector2 vector;

            AAB2.CreateFromPoints(points).CalcCenterExtents(out center, out vector);
            Circle2 result;

            result.Center = center;
            result.Radius = vector.magnitude;
            return(result);
        }