MathUtils = {
	/**
	 *  norm
	 * 
	 *	Normalizes a number from another range into a value between 0 and 1.
	 *	Identical to map(value, low, high, 0, 1).
	 *	
	 *	@param	v	The incoming value to be converted
	 *	@param	l	Lower bound of the value's current range
	 *	@param	h	Upper bound of the value's current range
	 */
	norm: function (v, l, h) {
		return (v - l) / (h - l);
	},
	
	/**
	 *  map
	 *	Re-maps a number from one range to another.
	 *	
	 *	@param	v	The incoming value to be converted
	 *	@param	l1	Lower bound of the value's current range
	 *	@param	h1	Upper bound of the value's current range
	 *	@param	l2	Lower bound of the value's target range
	 *	@param	h2	Upper bound of the value's target range
	 */
	map: function (v, l1, h1, l2, h2) {
		return ( MathUtils.norm( v, l1, h1) * (h2 - l2)) + l2;
	},
	
	/**
	 *  lerp
	 *
	 *	Calculates a number between two numbers at a specific increment.
	 *	e.g., (a == 5) is a value half-way in between v1 and v2.
	 *	
	 *	@param	v1	First value
	 *	@param	v2	Second value
	 *	@param	a	Amount, between 0 and 1
	 */
	lerp: function (v1, v2, a) {
		return ((v2 - v1) * a) + v1;
	}
}
