Question: how to sort a coordinate points

 hi everyone,   

I have a list of coordinates  and would like to sort them so that in the new order, the last coordinate will be the first coordinate and the first coordinate will be the first: 

   for example:  

  P:=array([[1,4],[2,3],[3,2],[4,1],[6,5],[6,1]]):   

should sort to  

  P:=array[ [6,1], [6,5], [4,1],[3,2],[2,3],[1,4]]  

 

  There must be an intelligent way to do this.  

  thanks for the help;

Please Wait...