Here is the vector version:
i = arange(255) j = arange(255) x = simple_func1(i) y = simple_func2(j) y = y.reshape(-1,1) A = alpha * x * y + beta * x**2 + gamma * y**2
If you want to fill in the last coordinates 1 and 0:
B = empty(A.shape+(3,)) B[:,:,0] = A B[:,:,1] = 1
source share