projects
/
platform
/
framework
/
web
/
crosswalk-tizen.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
96c4b787d16d7f4bf37b0bdd721990b84360a526
[platform/framework/web/crosswalk-tizen.git]
/
1
var lerp = require('./lerp');
2
var norm = require('./norm');
3
/**
4
* Maps a number from one scale to another.
5
* @example map(3, 0, 4, -1, 1) -> 0.5
6
*/
7
function map(val, min1, max1, min2, max2){
8
return lerp( norm(val, min1, max1), min2, max2 );
9
}
10
module.exports = map;
11