If the points are colinear, then you can compare them by comparing their coordinates directly. You don't need to calculate distance from origin or between points. And you don't need to sort the entire list to get the min and max.
Pseudo-code:
min = p0
max = p0
for each point p
if p.X < min.X || p.Y < min.Y then min = p
if p.X > max.X || p.Y > max.Y then max = p
You could fiddle with the algorithm somewhat: there's no need to check Y
unless the X
values are all identical.