Last active
August 29, 2015 14:23
-
-
Save WillSquire/3f1ebd3ec3e6cd3a805e to your computer and use it in GitHub Desktop.
LERP - Get from point a to point b over t.
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
/** | |
* Linear interpolation (LERP). | |
* | |
* Returns a value between value a to value b over t (0 to 1). | |
* | |
* @param {number} a | |
* @param {number} b | |
* @param {number} t | |
* @returns {number} | |
*/ | |
function lerp(a, b, t) { | |
return a + t * (b - a); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment