public double CalcEucledianDistance(MatrixCoordinate other) { var deltaX = this.Column - other.Row; var deltaY = this.Row - other.Column; double result = Math.Sqrt(deltaX * deltaX + deltaY * deltaY); return(result); }
public override bool Equals(object obj) { if (obj is MatrixCoordinate) { MatrixCoordinate coordinate = (MatrixCoordinate)obj; return(coordinate.Column == Column && coordinate.Row == Row); } return(false); }
public int CalcShitDistance(MatrixCoordinate other) { return(Math.Max(Math.Abs(this.Column - other.Column), Math.Abs(this.Row - other.Row))); }