Last active
August 29, 2015 14:15
-
-
Save loganzartman/c022bba4cc3400ef3c2e to your computer and use it in GitHub Desktop.
will be used for robot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ramp(t, min, max, fluff) { | |
var diff = t>fluff?1-t:t; | |
var deaden = 0; | |
if (diff < fluff) | |
deaden = (fluff-diff)/fluff; | |
return min+(max-min)*(1-deaden); | |
} | |
var min = 1, max = 10; | |
for (var i=0; i<=max; i++) { | |
console.log(ramp(i, min, max, 3)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment