Skip to content

Instantly share code, notes, and snippets.

View xavierlopez's full-sized avatar

Xavier López xavierlopez

View GitHub Profile
@demonixis
demonixis / MathHelper.js
Created December 4, 2012 10:38
JavaScript Math helper
var MathHelper = {
// Get a value between two values
clamp: function (value, min, max) {
if (value < min) {
return min;
}
else if (value > max) {
return max;
}