public override object Clone() { RealVector2d v = new RealVector2d(this.Name); v.X = this.X; v.Y = this.Y; return(v); }
public override bool Equals(object obj) { // Check if the object is null and of type RealVector2d. if (obj != null && obj.GetType() == typeof(RealVector2d)) { // Cast the object to a RealVector2d. RealVector2d vec = (RealVector2d)obj; // Check if the X and Y coords match. if (this.X.Equals(vec.X) == true && this.Y.Equals(vec.Y) == true) { return(true); } } // The objects do not match. return(false); }