fly icon indicating copy to clipboard operation
fly copied to clipboard

能解释下这段代码原理和作用么?

Open xdimh opened this issue 7 years ago • 0 comments

var distance = Math.sqrt(Math.pow(start.top - end.top, 2) + Math.pow(start.left - end.left, 2)),
        // 元素移动次数
        steps = Math.ceil(Math.min(Math.max(Math.log(distance) / 0.05 - 75, 30), 100) / settings.speed),
        ratio = start.top == vertex_top ? 0 : -Math.sqrt((end.top - vertex_top) / (start.top - vertex_top)),
        vertex_left = (ratio * start.left - end.left) / (ratio - 1),

特别是这里的steps

xdimh avatar Jun 12 '17 10:06 xdimh