List of utility methods to do Number Lerp
lerp(norm, min, max)Math.lerp = function(norm, min, max) { return (max - min) * norm + min; }; | |
isInRange(minRange, maxRange, parameter)Object.prototype.isInRange = function (minRange, maxRange, parameter) { if (!minRange.isNumber() || !minRange.isInteger()) { throwTypeException(parameter); if (!maxRange.isNumber() || !maxRange.isInteger()) { throwRangeException(parameter); if (!this.valueOf().isNumber()) { throwTypeException(parameter); ... |