def METHOD_NAME(shape, yx=None, subsample=0):
    """2D array of distances from a point.
    Parameters
    ----------
    shape : array
      The shape of the resulting array, (y, x).
    yx : array, optional
      The center of the array, (y, x).  If set to `None`, then the
      center is `(shape - 1.0) / 2.0`.  Integer values refer to the
      center of the pixel.
    subsample : int, optional
      Set to `>1` to sub-pixel sample the 11x11 pixel core of the
      array using `refine_pixel`.
    Returns
    -------
    r : ndarray
      The array of radial values.
    Example
    -------
    >>> from sbpy.imageanalysis.utils import rarray
    >>> r = rarray((5, 5))
    >>> r[2, 2]
    0.0
    >>> r = rarray((5, 5), yx=(0, 0))
    >>> r[2, 2]
    2.8284271247461903
    """
    import numpy as np
    if yx is None:
        yx = (np.array(shape) - 1) / 2
    else:
        yx = np.array(yx)
    y = yarray(shape, yx=yx)
    x = xarray(shape, yx=yx)
    r = np.sqrt(x**2 + y**2)
    if subsample > 1:
        Ny = min(shape[0], 11)
        Nx = min(shape[1], 11)
        y0, x0 = np.floor((yx + 0.5)).astype(int)
        for y in range(-Ny // 2 + y0, Ny // 2 + y0 + 1):
            for x in range(-Nx // 2 + x0, Nx // 2 + x0 + 1):
                f = refine_pixel(METHOD_NAME, subsample, (y, x), yx) * subsample
                r[y, x] = f
    return r