Add function to check if two rectangles are similar