groupByY groups by y-coordinates
get first point for Graham scan algorithm