P
P
Pavel2018-11-11 22:27:36
Mathematics
Pavel, 2018-11-11 22:27:36

How to add easing features to linear motion?

Good evening everyone! I am writing my tweener (analogue of DOTween) in order to better understand the internal functionality and understand how it works.
In DOTween, for each twin, it was possible to apply the smoothness function - EASE. I do not fully understand what they are from a mathematical point of view, hence I do not fully understand how to implement this in my own product. Can you suggest a couple of articles that explain this in an accessible language?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
G
GavriKos, 2018-11-11
@GavriKos

What an interesting translation - the smoothness function ... Although it seems to be correct.
At its core, this is simply the law of changing value over time.
Here are different options: https://easings.net/ru
You can imagine it with a graph - the benefit of the unit is that there are curves, you can - immediately with a function - it will be faster to calculate.
For example, a simple linear law:
x = k*t. t - time since the beginning of the animation, k - coefficient - in fact the speed.
Quadratic law:
x \u003d k * (t ^ 2) - more and more distance will be covered in the same time.
Well, etc.

G
GreatRash, 2018-11-12
@GreatRash

Here is the theory (ActionScript).
Here is the implementation (JavaScript).

K
Karpion, 2018-12-08
@Karpion

You can approximate the function with linear pieces - then there will be corners at the transitions. And you can use splines - square, cubic, and so on; then the result will be smoother.
If the system develops in time, then sometimes they simply add inertia. Without inertia - the speed is proportional to the force, and with a sharp change in force, the speed also changes sharply. And with the mass of a point, you have to take into account acceleration, there is a second-order differential equation.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question