public static Trapezium operator -(Trapezium x, Trapezium y) { Trapezium tmp = new Trapezium(); tmp.a = x.a - y.a; tmp.b = x.b - y.b; tmp.c = x.c - y.c; tmp.d = x.d - y.d; return(tmp); }
public static Trapezium operator *(Trapezium x, double y) { Trapezium tmp = new Trapezium(); tmp.a = x.a * y; tmp.b = x.b * y; tmp.c = x.c * y; tmp.d = x.d * y; return(tmp); }
public static Trapezium operator +(Trapezium x, Trapezium y) { Trapezium tmp = new Trapezium(); tmp.a = x.a + y.a; tmp.b = x.b + y.b; tmp.c = x.c + y.c; tmp.d = x.d + y.d; return(tmp); }
public override bool Equals(object x) { Trapezium obj = (Trapezium)x; if (a == obj.a && b == obj.b && c == obj.c && d == obj.d) { return(true); } else { return(false); } }
public static Trapezium operator /(Trapezium x, double y) { if (y == 0.0) { throw new DivideByZeroException(); } Trapezium tmp = new Trapezium(); tmp.a = x.a / y; tmp.b = x.b / y; tmp.c = x.c / y; tmp.d = x.d / y; return(tmp); }