let array= [ [[396.72, 241.07],[396.72, 241.07]], [[1,2]],[[2,1]] ,[[396.72, 241.07],[396.72, 241.07]], [[3,2],[9,1]] , [[2,1]],[[1,2]] ];
Unique Output: [ [[396.72, 241.07],[396.72, 241.07]], [[1,2],[2,1]], [[3,2],[9,1]] ]
For example, treat [[1,2]],[[2,1]] as a segment [[x1,y1],[x2,y2]] which has Point 1 and Point 2 .The points are interchangeable since if interchanged it will also form the same segment. May I ask how to find the unique of the array?
There is a solution on 2 dimensional array at here for Points or Coordinates, but its not exactly related to segment. Can anyone guide me on this matter :) ?