public bool NearlyEquals(PixelVector other) { const float tolerance = float.Epsilon; return(Math.Abs(_x - other._x) < tolerance && Math.Abs(_y - other._y) < tolerance); }
/// <summary> /// Translates the rectangle by an offset. /// </summary> /// <param name="offset">The offset.</param> /// <returns>The translated rectangle.</returns> public PixelRect Translate(PixelVector offset) { return(new PixelRect(Position + offset, Size)); }
/// <summary> /// Check if two vectors are equal (bitwise). /// </summary> /// <param name="other"></param> /// <returns></returns> public bool Equals(PixelVector other) { return(_x == other._x && _y == other._y); }