Skip to content

Instantly share code, notes, and snippets.

@gabriel-laet
Created September 27, 2010 18:48
Show Gist options
  • Select an option

  • Save gabriel-laet/599588 to your computer and use it in GitHub Desktop.

Select an option

Save gabriel-laet/599588 to your computer and use it in GitHub Desktop.
package
{
public function map(value:Number, startA:Number, endA:Number, startB:Number, endB:Number):Number
{
return startB + (endB - startB) * ((value - startA) / (endA - startA));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment