指定步长中间值

var a = function(num1, num2, length, ratio) {
        var max = Math.max(num1, num2), min = Math.min(num1, num2), list = [max], range = max - min, i;
        list[r] = min;
        for (i = 1; i < length; i++) {
            list[i] = (range = range / ratio) + min
        }
        return num1 > num2 ? list : list.reverse()
    };

 

posted @ 2012-05-15 08:55  穆乙  阅读(192)  评论(0编辑  收藏  举报