ktongue's picture
download
raw
427 Bytes
import {default as value} from "./value.js";
export default function piecewise(interpolate, values) {
if (values === undefined) values = interpolate, interpolate = value;
var i = 0, n = values.length - 1, v = values[0], I = new Array(n < 0 ? 0 : n);
while (i < n) I[i] = interpolate(v, v = values[++i]);
return function(t) {
var i = Math.max(0, Math.min(n - 1, Math.floor(t *= n)));
return I[i](t - i);
};
}

Xet Storage Details

Size:
427 Bytes
·
Xet hash:
92cbb97e8b9124cc74c48e7e527d04f72e1dc7be263a81bcfc2a3f0c0b321ba8

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.