Checks whether given points belong to rectangle.