function interpolateSum(index, width, height, X, Y, V) {
const U = new Float64Array(width * height);
for (const i of index) {
const x = Math.round(X[i]);
const y = Math.round(Y[i]);
if (x >= 0 && y >= 0 && x < width && y < height) U[x + width * y] += V[i];
}
return U;
}