def bilinear_interpolation(n1, n2, n3, n4, x, y):
    """
    Bilinear interpolation of value for point of interest (P).

    :param n1: value at node 1
    :param n2: value at node 2
    :param n3: value at node 3
    :param n4: value at node 4
    :param x: interpolation scale factor for x axis
    :param y: interpolation scale factor for y axis

    :return: value at node P
    """

    a0 = n1
    a1 = n2 - n1
    a2 = n3 - n1
    a3 = n1 + n4 - n2 - n3
    p = a0 + (a1 * x) + (a2 * y) + (a3 * x * y)
    return p