Code coverage report for math/map.js

Statements: 100% (5 / 5)      Branches: 100% (0 / 0)      Functions: 100% (3 / 3)      Lines: 100% (4 / 4)     

All files » math/ » map.js
1 2 3 4 5 6 7 8 9 10 111         1 3   1    
define(['./lerp', './norm'], function(lerp, norm){
    /**
    * Maps a number from one scale to another.
    * @example map(3, 0, 4, -1, 1) -> 0.5
    */
    function map(val, min1, max1, min2, max2){
        return lerp( norm(val, min1, max1), min2, max2 );
    }
    return map;
});