


javascript - An algorithm to calculate the degree of rotation for each frame
Sep 09, 2016 am 08:27 AM
<code>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) } </code>
I saw an algorithm in the WeChat turntable that calculates the degree of rotation of each frame of the turntable. Please explain it to me. (Mathematics is done by the physical education teacher)
Reply content:
<code>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) } </code>
I saw an algorithm in the WeChat turntable that calculates the degree of rotation of each frame of the turntable. Please explain it to me. (Mathematics is done by the physical education teacher)

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian

How To Set Up Visual Studio Code (VS Code) for PHP Development
