I have a list of (x, y)
coordinates and would like to expand the list as follows:
Input:
l = [[1, 2], [5, 2]]
Output:
l = [[1, 2], [2, 1], [-1, 2], [2, -1], [1, -2], [-2, 1], [-1, -2], [-2, -1], [5, 2],...]
I can only think of complicated ways to do this. Are there simple ways to do this? Which functions should I consider using?