Stumbled on this while working on a program code to display motion animation. The scenario is, the program will have a function to move a picture from its current position to move right. The program took only 2 variables, which is the travel distance and time to cover the distance. The distance is in pixel and the duration is in frames (in this case, the program runs in $60$ frames / second). Linear movement/zero acceleration is not a problem, the velocity can be found by simply by distance/time. But I'm stuck as the program requires acceleration and deceleration into the motion. The scenario is divided into 3 phases :
- The first $30%$ of time will be accelerating, from $0$ slowly increases its speed
- The next $40%$ of time, movement has no acceleration, during this, the speed always the same
- the last $30%$ of time will be decelerating, speed from the last speed of 2nd phase and slowly decrease its speed until it stops.
I'm not good at physics and what makes this tricky for me is that the only information I have is the total distance to be covered and the time needed to reach that distance. There are no limits on the velocity/acceleration.
Lets take an example: a picture needs to be moved $300$ pixels to the right in $70$ frames. My question is:
- What is the equation to calculate velocity in each frames for each phase in the above scenario?
- What is the equation of acceleration in phase $1$ and $3$?
Any help will be appreciated :) Thanks in advance