function getCenteredElement(matrix, l, i, j) {
  // Row-wise indexing.
  const index = (j + l) * (2 * l + 1) + (i + l);
  return matrix[l - 1][index].gain.value;
}
This is a helper function to allow us to access a matrix array in the same
manner, assuming it is a (2l+1) x (2l+1) matrix.
@param {Number[]} matrix - N matrices of gainNodes, each with (2n+1) x (2n+1)
elements, where n=1,2,...,N.
@param {Number} l
@param {Number} i
@param {Number} j
@return {Number}