Here you can find the source of isInRange(minRange, maxRange, parameter)
Object.prototype.isInRange = function (minRange, maxRange, parameter) { if (!minRange.isNumber() || !minRange.isInteger()) { throwTypeException(parameter);// w ww . ja v a 2s . co m } if (!maxRange.isNumber() || !maxRange.isInteger()) { throwRangeException(parameter); } if (!this.valueOf().isNumber()) { throwTypeException(parameter); } return (minRange < this.valueOf() && this.valueOf() < maxRange); };
Math.lerp = function(norm, min, max) { return (max - min) * norm + min; };