Skip to content

Instantly share code, notes, and snippets.

@balaam
Created February 14, 2014 02:23
Show Gist options
  • Select an option

  • Save balaam/8994728 to your computer and use it in GitHub Desktop.

Select an option

Save balaam/8994728 to your computer and use it in GitHub Desktop.
public static float LerpF( float value, float in0, float in1, float out0, float out1 )
{
float normed = (value - in0) / (in1 - in0);
float result = out0 + (normed * (out1 - out0));
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment