public static Point GetCenter(this Point[] p) { double X = p.Average(x => x.X); double Y = p.Average(x => x.Y); return new Point((int)X, (int)Y); }