--[[ @brief Adds the same value to all numbers in an array so the sum is 0.
     @example AdditiveNormalize({5, 10, 15}) = {-5, 0, 5}
     @param t The array to normalize.
     @return The normalized array.
--]]

function module.AdditiveNormalize(t)
	local offset = module.Sum(t) / #t;
	for i, v in pairs(t) do
		t[i] = v - offset;
	end
	return t;
end
