def get_convex_polygons(self, m, print_out=False):
        """
        :param m: size of polygones (number of corners)
        
        :return: (ordered) indices of all convex polygones of size m.
        """
        convex_polygons = []
        for corners in itertools.combinations(np.arange(self.N), m):
            p = np.zeros(m, np.uint)
            p[0] = corners[0]
            left = corners[1:]
            # loop through second corners
            for i, second in enumerate(corners[1:m - 1]):
                p[1] = second
                left = np.delete(corners, (0, i + 1))
                for j, last in enumerate(corners[i + 2:]):
                    left = np.delete(corners, (0, i + 1, j + i + 2))
                    p[-1] = last
                    # loop through all permutations of left corners.
                    for permut in itertools.permutations(left):
                        p[2:-1] = permut
                        sum_theta = 0
                        # sum over all inner angles.
                        for k in range(m):
                            sum_theta += self.get_inner_angle(
                                p[1], (p[0], p[2]))
                            p = np.roll(p, 1)
                        angle = sum_theta
                        sum_angle = (m - 2) * pi
                        if (abs(angle - sum_angle) < 1e-14 or
                                abs(angle) < 1e-14):
                            if (print_out):
                                print("convex polygon found:    ", p)
                            convex_polygons.append(p.copy())
                        #  elif (angle < sum_angle):
                        #  if (print_out): print("non convex polygon found:",p,angle)
                        elif (angle > sum_angle):
                            if (print_out):
                                print("oops")
        return convex_polygons
def get_convex_polygons ( self , m , print_out = False ) : convex_polygons = [ ] for corners in itertools . combinations ( np . arange ( self . N ) , m ) : p = np . zeros ( m , np . uint ) p [ 0 ] = corners [ 0 ] left = corners [ 1 : ] for i , second in enumerate ( corners [ 1 : m - 1 ] ) : p [ 1 ] = second left = np . delete ( corners , ( 0 , i + 1 ) ) for j , last in enumerate ( corners [ i + 2 : ] ) : left = np . delete ( corners , ( 0 , i + 1 , j + i + 2 ) ) p [ - 1 ] = last for permut in itertools . permutations ( left ) : p [ 2 : - 1 ] = permut sum_theta = 0 for k in range ( m ) : sum_theta += self . get_inner_angle ( p [ 1 ] , ( p [ 0 ] , p [ 2 ] ) ) p = np . roll ( p , 1 ) angle = sum_theta sum_angle = ( m - 2 ) * pi if ( abs ( angle - sum_angle ) < 1e-14 or abs ( angle ) < 1e-14 ) : if ( print_out ) : print ( "convex polygon found:    " , p ) convex_polygons . append ( p . copy ( ) ) elif ( angle > sum_angle ) : if ( print_out ) : print ( "oops" ) return convex_polygons
:param m: size of polygones (number of corners)
        
        :return: (ordered) indices of all convex polygones of size m.