source: node_modules/d3-ease/src/poly.js@ e4c61dd

Last change on this file since e4c61dd was e4c61dd, checked in by istevanoska <ilinastevanoska@…>, 6 months ago

Prototype 1.1

  • Property mode set to 100644
File size: 596 bytes
Line 
1var exponent = 3;
2
3export var polyIn = (function custom(e) {
4 e = +e;
5
6 function polyIn(t) {
7 return Math.pow(t, e);
8 }
9
10 polyIn.exponent = custom;
11
12 return polyIn;
13})(exponent);
14
15export var polyOut = (function custom(e) {
16 e = +e;
17
18 function polyOut(t) {
19 return 1 - Math.pow(1 - t, e);
20 }
21
22 polyOut.exponent = custom;
23
24 return polyOut;
25})(exponent);
26
27export var polyInOut = (function custom(e) {
28 e = +e;
29
30 function polyInOut(t) {
31 return ((t *= 2) <= 1 ? Math.pow(t, e) : 2 - Math.pow(2 - t, e)) / 2;
32 }
33
34 polyInOut.exponent = custom;
35
36 return polyInOut;
37})(exponent);
Note: See TracBrowser for help on using the repository browser.