public static Tochka operator -(Tochka obj1, Tochka obj2) { Tochka result = new Tochka(); result.x = obj1.x - obj2.x; result.y = obj1.y - obj2.y; return(result); }
static void Main(string[] args) { Tochka start1 = new Tochka(); Tochka end1 = new Tochka(3, 9); Tochka start2 = new Tochka(end1); Vidrizok W1 = new Vidrizok(start1, end1); Vidrizok W2 = new Vidrizok(start2, 8, 5); Vidrizok W3 = new Vidrizok(W2); W3.Sdvig(3, 0); W3 = W1 + W2; }
public Tochka(Tochka obj) : this(obj.x, obj.y) { }
public void Sdvig(double x, double y) { this.start = this.start + new Tochka(x, y); this.end = this.end + new Tochka(x, y); this.Getdlina(); }
public Vidrizok(double x1, double y1, Tochka e) { start = new Tochka(x1, y1); end = e; Getdlina(); }
public Vidrizok(Tochka s, double x2, double y2) { start = s; end = new Tochka(x2, y2); Getdlina(); }
public Vidrizok(double x1, double y1, double x2, double y2) { start = new Tochka(x1, y1); end = new Tochka(x2, y2); Getdlina(); }
public Vidrizok(Tochka s, Tochka e) { start = s; end = e; Getdlina(); }