# Decelerate function to match with the example

There is a system which uses its own decelerate function for animations, and I have to implement it manually to be as close to the sample as it can.

Here is the sample function (sorry, not too sophisticated, but this is all they have provided):

Basic things: Both t and n go from 0 to 1.

I have tried 1-1/t, but it has a very hard slope at beginning:

Anything else I have tried ruined the scale. I think this is a very easy problem to solve, but still can't find the right function yet.

Would be appreciated if you can help me out.

As it turned out, this is not that easy, so I have created a simulator where we can validate the ideas: https://www.desmos.com/calculator/4arts2sk99

I don't know if you can edit and save it, but if you post an answer I will add into that, and then we can create a screenshot as well.

Thanks all who is helping me with this.

welcome to the site !

In my opinion, you can go follow two routes :

• Either a "parametric route", coming up with an a priori form for your expression, and then fit the parameters to your data. Maybe visually at first, or using some kind of more precise framework if you are not satisfied (least squares for instance, see https://en.wikipedia.org/wiki/Least_squares)

• Or a non parametric one, going from your image to a table of numbers. This free open source software does it quite well http://markummitchell.github.io/engauge-digitizer/

You can try the system of functions

$$f(x) = x^{1/n}$$ for any suitable vaule of n where n>1 (Note: n doesn't have to be an integer)

(the higher the value of n the more sharp the change is...)

You can check that $$f(0)=0$$ AND $$f(1)=1$$ And the slope of the function is

$$f'(x)=1/{nx^{(n-1)/n}}$$

Or even better if a inverted parabola with roots 0,√2 is rotated by 45° anticlockwise...

Ie. $$f(x) = ax(x-√2)$$ is the rotated by 45°

Ie. $$ay^2 +(2a-2ax-√2)y+ax^2-2ax-√2x =0$$ use this if you can put y as a variable as well,if you can't then ...

$$y=(-(2a-2ax-√2)+√((2a-2ax-√2)^2-4a(ax^2-2ax-√2x)))/2a$$

Hopefully I didn't do any mistakes...

• Thank you. I have tried with 1/4, 1/5, 1/6: imgur.com/a/QbSCDVR All seems a bit unbalanced. Is there some way to make it "simmetrical" to the line? Jan 12 at 9:17
• You know waht I just thought that if it were a rotated parabola it would be symmetricall... Wait for some time while I word it mathematically Jan 12 at 9:25
• What shall be a? in the first case here are my results: imgur.com/a/qTY7kvU Jan 12 at 10:28
• I will accept your answer if you can help me finetuning it. It does not look good, here is a simulator: desmos.com/calculator/4arts2sk99 Jan 12 at 11:42