If you just want a bounding box, easy enough:
min_x = MAX_INT; min_y = MAX_INT; max_x = MIN_INT; max_y = MIN_INT; for p in points: if px < min_x then min_x = px; if py < min_y then min_y = py; if px > max_x then max_x = px; if py > max_y then max_y = px;
If your platform does not have the simple equivalent of MAX_INT and MIN_INT, simply select the first one in the list. This may be a less βcuteβ code, but it may also be faster with a pointless amount.
Of course, if your data was ordered in some significant way, you could do something smarter than repeating more than 60 thousand elements and making comparisons of 240 thousand (Bearing in mind that ordering 60 thousand points is some significant the way just for this may not pay itself.)
source share