MCPcopy Index your code
hub / github.com/plotly/plotly.js / interp1d

Function interp1d

stackgl_modules/index.js:30071–30079  ·  view source on GitHub ↗
(arr, x)

Source from the content-addressed store, hash-verified

30069
30070
30071function interp1d(arr, x) {
30072 var ix = Math.floor(x)
30073 , fx = x - ix
30074 , s0 = 0 <= ix && ix < arr.shape[0]
30075 , s1 = 0 <= ix+1 && ix+1 < arr.shape[0]
30076 , w0 = s0 ? +arr.get(ix) : 0.0
30077 , w1 = s1 ? +arr.get(ix+1) : 0.0
30078 return (1.0-fx)*w0 + fx*w1
30079}
30080
30081function interp2d(arr, x, y) {
30082 var ix = Math.floor(x)

Callers 1

interpolateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…