source: node_modules/d3-interpolate/src/basisClosed.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: 363 bytes
Line 
1import {basis} from "./basis.js";
2
3export default function(values) {
4 var n = values.length;
5 return function(t) {
6 var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n),
7 v0 = values[(i + n - 1) % n],
8 v1 = values[i % n],
9 v2 = values[(i + 1) % n],
10 v3 = values[(i + 2) % n];
11 return basis((t - i / n) * n, v0, v1, v2, v3);
12 };
13}
Note: See TracBrowser for help on using the repository browser.