Last active
August 29, 2015 14:15
-
-
Save vanrez-nez/f9028e71c3934a3dfce2 to your computer and use it in GitHub Desktop.
linearly interpolate between two values
This file contains hidden or 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
//returns the interpolated value from a and b at the given weight (from 0 to 1) | |
var lerp = function(a, b, w) { | |
return (1 - w) * a + w * b; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment