def int2coord(index, size=3):
    """
        Converts a scalar value back to coordinate pairs

    :param index:
    :param size: the width/height of a perfect square
    :return:
    """

    x = index // size
    y = index - x*size

    return dict(x=x, y=y)