flow like the river
This commit is contained in:
commit
013fe673f3
42435 changed files with 5764238 additions and 0 deletions
46
VISUALIZACION/node_modules/d3-ease/src/elastic.js
generated
vendored
Executable file
46
VISUALIZACION/node_modules/d3-ease/src/elastic.js
generated
vendored
Executable file
|
|
@ -0,0 +1,46 @@
|
|||
import {tpmt} from "./math.js";
|
||||
|
||||
var tau = 2 * Math.PI,
|
||||
amplitude = 1,
|
||||
period = 0.3;
|
||||
|
||||
export var elasticIn = (function custom(a, p) {
|
||||
var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);
|
||||
|
||||
function elasticIn(t) {
|
||||
return a * tpmt(-(--t)) * Math.sin((s - t) / p);
|
||||
}
|
||||
|
||||
elasticIn.amplitude = function(a) { return custom(a, p * tau); };
|
||||
elasticIn.period = function(p) { return custom(a, p); };
|
||||
|
||||
return elasticIn;
|
||||
})(amplitude, period);
|
||||
|
||||
export var elasticOut = (function custom(a, p) {
|
||||
var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);
|
||||
|
||||
function elasticOut(t) {
|
||||
return 1 - a * tpmt(t = +t) * Math.sin((t + s) / p);
|
||||
}
|
||||
|
||||
elasticOut.amplitude = function(a) { return custom(a, p * tau); };
|
||||
elasticOut.period = function(p) { return custom(a, p); };
|
||||
|
||||
return elasticOut;
|
||||
})(amplitude, period);
|
||||
|
||||
export var elasticInOut = (function custom(a, p) {
|
||||
var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);
|
||||
|
||||
function elasticInOut(t) {
|
||||
return ((t = t * 2 - 1) < 0
|
||||
? a * tpmt(-t) * Math.sin((s - t) / p)
|
||||
: 2 - a * tpmt(t) * Math.sin((s + t) / p)) / 2;
|
||||
}
|
||||
|
||||
elasticInOut.amplitude = function(a) { return custom(a, p * tau); };
|
||||
elasticInOut.period = function(p) { return custom(a, p); };
|
||||
|
||||
return elasticInOut;
|
||||
})(amplitude, period);
|
||||
Loading…
Add table
Add a link
Reference in a new issue