Last active
August 29, 2015 14:07
-
-
Save hongkheng/93f25c283a6a05c632d2 to your computer and use it in GitHub Desktop.
Linear Interpolation formula
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 | |
function interpolateVal(y0:Number, y1:Number, x:Number, x1:Number, x0:Number):Number | |
{ | |
//y = y0 + (x - x0) * (y1 - y0) / (x1 - x0); | |
return y0 + (x - x0) * (y1 - y0) / (x1 - x0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment