public static Punto2D Baricentro(Punto2D[] Puntos) { double x = 0; double y = 0; x = 0; y = 0; for (int i = 0; i <= Puntos.GetUpperBound(0); i++) { x += Puntos[i].X; y += Puntos[i].Y; } return new Punto2D(x / (Puntos.GetUpperBound(0) + 1), y / (Puntos.GetUpperBound(0) + 1)); }
public static System.Drawing.Point[] ToPoint(Punto2D[] Puntos) { System.Drawing.Point[] Retorno = new System.Drawing.Point[Puntos.GetUpperBound(0) + 1]; for (int i = 0; i <= Puntos.GetUpperBound(0); i++) { Retorno[i] = ToPoint(Puntos[i]); } return Retorno; }