Given a set of distinct points in 2D space, and a rectangle (coordinates of all four points, sides parallel with xy axis) how can I quickly find which points are inside the rect
You could group point in sectors. If a sector is completely in or out of given rectangle then all point within it are also in or out. If a sector is partially in then you have to search O(n) for points in that sector to check if they are in the rectangle. Look for k-d tree search.