The full quote from that answer is (I added the numbers for easy reference):
- let
P[0], P[1], ... P[n-1]
be the list of points to sort
- let M be the barycenter of all points
- compute
a[0], a[1], ... a[n-1]
such that a[i] = atan2(P[i].y - M.y, P[i].x - M.x);
- sort points relative to their
a
value, using qsort
for instance.
The "a
value" part of step 4 is referencing step 3. So, in step 4 it's saying "sort the points array based on the values in the array you made in step 3 (using something like quick sort)."
Now, if sorting that array of values will get you the clockwise order of points, then sorting it in reverse order will give you the points in a counter-/anti-clockwise direction.
Hopefully that clears it up a bit for you.