var a = 0.01;
var totalDeg = 360;
var steps = [];
function countSteps() {
var t = Math.sqrt(2 * totalDeg / a);
var v = a * t;
for (var i = 0; i < t; i++) {
steps.push((2 * v * i - a * i * i) / 2)
}
steps.push(totalDeg)
}Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
匀减速距离公式
s=vi−1/2ai2
a:加速度
v:初速度
i:时间/步数
t:总时间/总步数
代码在模拟一个圆周上的匀减速运动,到停止时刚好转过一圈(s=360)。