Say we have a list:
{{1/2, -(Sqrt[3]/2)}, {1, 0}, {1/2, Sqrt[3]/2}, {-(1/2), Sqrt[3]/2}, {-1, 0}, {-(1/2), -(Sqrt[3]/2)}}
now we want to sort that list by looking at the second component of each sub list (call it y coordinate for ease), i.e. sort it s.t. y is in the descending order. So we'd get
{{1/2, Sqrt[3]/2},{-1/2, Sqrt[3]/2},{1,0},{-1,0},{1/2,-(Sqrt[3]/2)},{-1/2,-(Sqrt[3]/2)}}
And yeah, I should mention that if there are more than one sub lists with equal y, we would additionally (sub)sort them by descending x (first component in each of the sub lists).
I tried to use SortBy, in different forms, but I don't seem to be able to figure it out by myself. I'd appreciate any help.
SortBy[list, N[-Last[#]]&]
instead. $\endgroup$N[Last]
is not a function, so it's not appropriate here. UseN@*Last
orN[Last[#]]&
. $\endgroup$