Question: sorting

I have a list of coordinates  and would like to sort them so that in the new order, the third coordinate is increasing.

For example,

data:=[ [2,3,1], [3,6,-1], [5,0,3] ]

should sort to

[ [3,6,-1], [2,3,1], [5,0,3] ]

There must be an intelligent way to do this.

 

Please Wait...