import numpy as np


def get_position_of_minimum(matrix):
    return np.unravel_index(np.nanargmin(matrix), matrix.shape)


def get_position_of_maximum(matrix):
    return np.unravel_index(np.nanargmax(matrix), matrix.shape)


def get_distance_matrix(cell_grid_x, cell_grid_y, x, y):
    return np.sqrt((x - cell_grid_x) ** 2 + (y - cell_grid_y) ** 2)


def get_distance_matrix_squared(cell_grid_x, cell_grid_y, x, y):
    return (x - cell_grid_x) ** 2 + (y - cell_grid_y) ** 2

[((13, 11, 13, 67), 'numpy.sqrt', 'np.sqrt', ({(13, 19, 13, 66): '((x - cell_grid_x) ** 2 + (y - cell_grid_y) ** 2)'}, {}), '((x - cell_grid_x) ** 2 + (y - cell_grid_y) ** 2)', True, 'import numpy as np\n'), ((5, 28, 5, 48), 'numpy.nanargmin', 'np.nanargmin', ({(5, 41, 5, 47): 'matrix'}, {}), '(matrix)', True, 'import numpy as np\n'), ((9, 28, 9, 48), 'numpy.nanargmax', 'np.nanargmax', ({(9, 41, 9, 47): 'matrix'}, {}), '(matrix)', True, 'import numpy as np\n')]