This article mainly introduces the method of simulating the parabolic motion of JavaScript in the gravity state. The example analyzes the method of simulating the movement of javascript dom elements, which has some reference value, for more information about how to simulate the parabolic movement in the gravity state of JavaScript, see the example in this article. Share it with you for your reference. The specific analysis is as follows:
This JavaScript code simulates the parabolic motion in the gravity state. you can set the following parameters: horizontal initial velocity, vertical initial velocity, and gravity acceleration (if this acceleration is a time-varying value, can achieve other non-uniformly accelerated motion effects), animation interval, etc., relatively professional
Js parabolic motion
Simulate the parabolic motion in the gravity state (if 1px = 1mm)Horizontal initial speed:Px/MS
Vertical initial speed:Px/MS
Gravity acceleration:Px/square ms
(If this acceleration is a time-varying value, it will be able to achieve the effect of other non-uniformly accelerated motion .)
Unit time:(Interval of recording motion)
O