s = (nx-1)sx2 + (ny-1)sy2)