Ensure number is within a range
num clamp(num min, num max) { if (this < min) return min; if (this > max) return max; return this; }