Skip to content

Instantly share code, notes, and snippets.

@flockast
Created March 23, 2022 11:57
Show Gist options
  • Save flockast/ca67b605711ad9217d25efcc4cb3baa1 to your computer and use it in GitHub Desktop.
Save flockast/ca67b605711ad9217d25efcc4cb3baa1 to your computer and use it in GitHub Desktop.
Linear Interpolation js
const linearInterpolation = (x1, y1, x2, y2, x) => y1 + (x - x1) * ((y2 - y1) / (x2 - x1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment