define(['./lerp', './norm'], function(lerp, norm){
    /**
    * Maps a number from one scale to another.
    * @example map(3, 0, 4, -1, 1) -> 0.5
    */
    /**
     * Description
     * @method map
     * @param {} val
     * @param {} min1
     * @param {} max1
     * @param {} min2
     * @param {} max2
     * @return CallExpression
     */
    function map(val, min1, max1, min2, max2){
        return lerp( norm(val, min1, max1), min2, max2 );
    }
    return map;
});
