Skip to content

Instantly share code, notes, and snippets.

@JohnForbes
Last active September 7, 2021 04:50
Show Gist options
  • Select an option

  • Save JohnForbes/7130661 to your computer and use it in GitHub Desktop.

Select an option

Save JohnForbes/7130661 to your computer and use it in GitHub Desktop.
Interpolation Code
def interpolate(x,xmin,xmax,ymin,ymax):
return ymin+(ymax-ymin)*((x-xmin)/(xmax-xmin))
print interpolate(0,1,0,1,0.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment