from typing import Tuple


def __nb_xy2rowcol(
    xy: Tuple[float, float], inverse_transform: Tuple[float, ...]
) -> Tuple[float, float]:
    """numba version of xy2rowcol

    Parameters
    ----------
    xy : Tuple[float, float]
        coordinate
    inverse_transform : Tuple[float, ...]
        affine parameter as tuple

    Returns
    -------
    Tuple[float, float]
        row, column
    """

    # x, y = xy
    # a, b, c, d, e, f, _, _, _ = inverse_transform
    # return x * d + y * e + f, x * a + y * b + c
    return (
        xy[0] * inverse_transform[3]
        + xy[1] * inverse_transform[4]
        + inverse_transform[5],
        xy[0] * inverse_transform[0]
        + xy[1] * inverse_transform[1]
        + inverse_transform[2],
    )