--Math

function Util.normalize(normMin, normMax, value, realMin, realMax)
	if realMin == nil then
		realMin = 0
	end
	if realMax == nil then
		realMax  = 1
	end
	local value = (value - realMin)/(realMax - realMin) * (normMax - normMin) + normMin
	return value
end

function Util.denormalize(min, max, value)
	return (value * (max - (min)) + (min))
end

function Util.invertValue(value, largestValue, smallestValue)
	return (largestValue - value) + smallestValue
end
