public static Coordinate toCoordinate(string rhs) { string[] sub_strings = rhs.Split(','); int _x, _y; int.TryParse (sub_strings[0],out _x); int.TryParse (sub_strings[1],out _y); Coordinate result = new Coordinate(_x, _y); return result; }
public static Coordinate operator-(Coordinate rhs) { Coordinate result = new Coordinate (-rhs.x, -rhs.y); return result; }
public Coordinate(Coordinate rhs) {x=rhs.x; y=rhs.y;}
public static Coordinate operator-(Coordinate lhs, Coordinate rhs) { Coordinate result = new Coordinate (lhs.x - rhs.x, lhs.y - rhs.y); return result; }
public bool Equals(Coordinate rhs) { // Return true if the fields match: return (x == rhs.x) && (y == rhs.y); }