using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Figury { public class Prostokąt :Wielobok { public Prostokąt(Punkt x1, Punkt x2) : base(4) { Nazwa = "prostokąt"; w[0] = x1; w[1].x = x1.x; w[1].y = x2.y; w[2] = x2; w[3].x = x2.x; w[3].y = x1.y; } public override double Pole() { return w[0].OdległośćOdPunktu(w[1]) * w[0].OdległośćOdPunktu(w[3]); } } }