MCPcopy Create free account
hub / github.com/idank/explainshell / d3_svg_lineFiniteDifferences

Function d3_svg_lineFiniteDifferences

explainshell/web/static/js/d3.v3.js:3900–3907  ·  view source on GitHub ↗
(points)

Source from the content-addressed store, hash-verified

3898 return (p1[1] - p0[1]) / (p1[0] - p0[0]);
3899 }
3900 function d3_svg_lineFiniteDifferences(points) {
3901 var i = 0, j = points.length - 1, m = [], p0 = points[0], p1 = points[1], d = m[0] = d3_svg_lineSlope(p0, p1);
3902 while (++i < j) {
3903 m[i] = (d + (d = d3_svg_lineSlope(p0 = p1, p1 = points[i + 1]))) / 2;
3904 }
3905 m[i] = d;
3906 return m;
3907 }
3908 function d3_svg_lineMonotoneTangents(points) {
3909 var tangents = [], d, a, b, s, m = d3_svg_lineFiniteDifferences(points), i = -1, j = points.length - 1;
3910 while (++i < j) {

Callers 1

Calls 1

d3_svg_lineSlopeFunction · 0.85

Tested by

no test coverage detected