@staticmethod
def __inRect(x, y, diaPointA, diaPointB):
    """Check if point (x,y) is within an axis-aligned rect
		with the diagonal (diaPointA,diaPointB).
		"""
    diaMinX, diaMaxX = min(diaPointA.x, diaPointB.x), max(diaPointA.x,
        diaPointB.x)
    diaMinY, diaMaxY = min(diaPointA.y, diaPointB.y), max(diaPointA.y,
        diaPointB.y)
    return x >= diaMinX and x <= diaMaxX and y >= diaMinY and y <= diaMaxY
