# Grouping symmetric points in 2D domain

I have the following list of points

L = {
{-0.980187,-1.07694}, {-0.980187,1.07694},
{-0.788396,-1.81236},{-0.788396,1.81236},
{-0.437793,-1.07694},{-0.437793,1.07694},
{-0.157935,-1.81236},{-0.157935,1.81236},
{0.157935,-1.81236},{0.157935,1.81236},
{0.437793,-1.07694},{0.437793,1.07694},
{0.788396,-1.81236},{0.788396,1.81236},
{0.980187,-1.07694},{0.980187,1.07694}
}


Which are distributed in four symmetric sets each having the points $$(x,y), (-x,y),(x,-y),(-x,-y)$$

(see image below).

I'd like to group the points based in their symmetry in a new list L1 in the following way

$$L1 = \{l1,l2,l3,l4\},$$ where $$l_i = \{\{x_i, y_i\},\{-x_i, y_i\},\{x_i, -y_i\},\{-x_i, -y_i\}\}, i=1,2,3,4$$

I would use GatherBy[data,Abs]

ClearAll[L, l];

L = GatherBy[data, Abs];

l[n_] := L[[n]]

ListPlot[ L ]


• This is really amazing and works for any list what ever the length is. Thank you :) Feb 1 at 11:37

Just another way:

Map[Extract[L, #] &, Reverse@Partition[List /@ OrderingBy[L, Abs], {4}]] // ListPlot


l1 = Select[L, #[[1]] > 0 && #[[2]] > 0 &]
l2 = Select[L, #[[1]] < 0 && #[[2]] > 0 &]
l3 = Select[L, #[[1]] > 0 && #[[2]] < 0 &]
l4 = Select[L, #[[1]] < 0 && #[[2]] < 0 &]


Visualization

ListPlot[{l1, l2, l3, l4}, PlotRange -> {{-1.1, 1.1}, {-2.1, 2.1}}]


• Thank you for this answer. GatherBy seems to be easier. Feb 1 at 11:39
• I interpreted this question similarly.
– Syed
Feb 1 at 11:39