def rotate(self, axis, theta):
        '''

        Parameters
        ----------
        axis: np.array
            rotation axis
        theta: float
            anglo in degrees counterclock wise

        Returns
        -------

        '''
        M = rotation_matrix(axis, np.deg2rad(theta))
        rot_pos = np.dot(M, self.positions.T).T
        rot_pos = np.round(rot_pos, 3)
        rot_axis = np.dot(M, self.main_axes.T).T
        self.main_axes = np.round(rot_axis, 3)
        normal = np.cross(rot_pos[1] - rot_pos[0], rot_pos[-1] - rot_pos[0])
        self.normal = np.round(normal, 3)
        self.normal /= np.linalg.norm(self.normal)

        self._set_positions(rot_pos)
        self._set_normal(normal)
def rotate ( self , axis , theta ) : M = rotation_matrix ( axis , np . deg2rad ( theta ) ) rot_pos = np . dot ( M , self . positions . T ) . T rot_pos = np . round ( rot_pos , 3 ) rot_axis = np . dot ( M , self . main_axes . T ) . T self . main_axes = np . round ( rot_axis , 3 ) normal = np . cross ( rot_pos [ 1 ] - rot_pos [ 0 ] , rot_pos [ - 1 ] - rot_pos [ 0 ] ) self . normal = np . round ( normal , 3 ) self . normal /= np . linalg . norm ( self . normal ) self . _set_positions ( rot_pos ) self . _set_normal ( normal )
Parameters
        ----------
        axis: np.array
            rotation axis
        theta: float
            anglo in degrees counterclock wise

        Returns
        -------