/**
 * @author alteredq / http://alteredqualia.com/
 */

THREE.Math = {

	// Clamp value to range <a, b>

	clamp: function ( x, a, b ) {

		return ( x < a ) ? a : ( ( x > b ) ? b : x );

	},

	// Clamp value to range <a, inf)

	clampBottom: function ( x, a ) {

		return x < a ? a : x;

	},

	// Linear mapping from range <a1, a2> to range <b1, b2>

	mapLinear: function ( x, a1, a2, b1, b2 ) {

		return b1 + ( x - a1 ) * ( b2 - b1 ) / ( a2 - a1 );

	},

	// Random float from <0, 1> with 16 bits of randomness
	// (standard Math.random() creates repetitive patterns when applied over larger space)

	random16: function () {

		return ( 65280 * Math.random() + 255 * Math.random() ) / 65535;

	},

	// Random integer from <low, high> interval

	randInt: function ( low, high ) {

		return low + Math.floor( Math.random() * ( high - low + 1 ) );

	},

	// Random float from <low, high> interval

	randFloat: function ( low, high ) {

		return low + Math.random() * ( high - low );

	},

	// Random float from <-range/2, range/2> interval

	randFloatSpread: function ( range ) {

		return range * ( 0.5 - Math.random() );

	},

	sign: function ( x ) {

		return ( x < 0 ) ? -1 : ( ( x > 0 ) ? 1 : 0 );

	}

};

@@ -1199,11 +1199,255 @@
 );%0A%0A%09%7D%0A%0A
-%7D
+%09degreesToRadians: function( degrees ) %7B%0A%0A%09  return degrees * THREE.Math.__d2r;%0A%0A%09%7D;%0A%0A%09radiansToDegrees: function( radians ) %7B%0A%0A%09  return radians * THREE.Math.__r2d;%0A%0A%09%7D;%0A%0A%0A%7D;%0A%0ATHREE.Math.__d2r =  Math.PI / 180;%0ATHREE.Math.__r2d =  180 / Math.PI
 ;%0A

add degreesToRadians / radiansToDegrees to Math.