예제 #1
0
 /// <summary>
 /// 获取多个点的平均位置
 /// </summary>
 /// <param name="points"></param>
 /// <returns></returns>
 public static PointF Average(this PointF @this, params PointF[] points)
 {
     PointF[] newPoints = new PointF[points.Length + 1];
     for (int i = 0; i < points.Length; i++)
     {
         newPoints[i] = points[i];
     }
     newPoints[points.Length] = @this;
     return(new PointF(newPoints.Average(p => p.X), newPoints.Average(p => p.Y)));
 }