parameters: (rotate_mat, anchor_x, anchor_y, length)
return_statement: return rotated_x, rotated_y
docstring: get rotated locations of all pixels for next stages
      Input:
          rotate_mat: rotatation matrix
          anchor_x  : fixed x position
          anchor_y  : fixed y position
          length    : length of image
      Output:
          rotated_x : rotated x positions <numpy.ndarray, (length,length)>
          rotated_y : rotated y positions <numpy.ndarray, (length,length)>
docstring_summary: get rotated locations of all pixels for next stages
      Input:
          rotate_mat: rotatation matrix
          anchor_x  : fixed x position
          anchor_y  : fixed y position
          length    : length of image
      Output:
          rotated_x : rotated x positions <numpy.ndarray, (length,length)>
          rotated_y : rotated y positions <numpy.ndarray, (length,length)>
docstring_tokens: get rotated locations of all pixels for next stages Input : rotate_mat : rotatation matrix anchor_x : fixed x position anchor_y : fixed y position length : length of image Output : rotated_x : rotated x positions <numpy . ndarray ( length length ) > rotated_y : rotated y positions <numpy . ndarray ( length length ) >
function: def rotate_all_pixels(rotate_mat, anchor_x, anchor_y, length):
      '''get rotated locations of all pixels for next stages
      Input:
          rotate_mat: rotatation matrix
          anchor_x  : fixed x position
          anchor_y  : fixed y position
          length    : length of image
      Output:
          rotated_x : rotated x positions <numpy.ndarray, (length,length)>
          rotated_y : rotated y positions <numpy.ndarray, (length,length)>
      '''
      x = np.arange(length)
      y = np.arange(length)
      x, y = np.meshgrid(x, y)
      x_lin = x.reshape((1, x.size))
      y_lin = y.reshape((1, x.size))
      coord_mat = np.concatenate((x_lin, y_lin), 0)
      rotated_coord = np.dot(rotate_mat, coord_mat - np.array([[anchor_x], [anchor_y]])) + \
                      np.array([[anchor_x], [anchor_y]])
      rotated_x = rotated_coord[0, :].reshape(x.shape)
      rotated_y = rotated_coord[1, :].reshape(y.shape)
      return rotated_x, rotated_y
function_tokens: def rotate_all_pixels ( rotate_mat , anchor_x , anchor_y , length ) : x = np . arange ( length ) y = np . arange ( length ) x , y = np . meshgrid ( x , y ) x_lin = x . reshape ( ( 1 , x . size ) ) y_lin = y . reshape ( ( 1 , x . size ) ) coord_mat = np . concatenate ( ( x_lin , y_lin ) , 0 ) rotated_coord = np . dot ( rotate_mat , coord_mat - np . array ( [ [ anchor_x ] , [ anchor_y ] ] ) ) + np . array ( [ [ anchor_x ] , [ anchor_y ] ] ) rotated_x = rotated_coord [ 0 , : ] . reshape ( x . shape ) rotated_y = rotated_coord [ 1 , : ] . reshape ( y . shape ) return rotated_x , rotated_y