- Notifications
You must be signed in to change notification settings - Fork4
Multilinear interpolation for ndarrays
License
NotificationsYou must be signed in to change notification settings
scijs/ndarray-linear-interpolate
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Multilinear (iebilinear/trilinear) interpolation for ndarrays.
varndarray=require("ndarray")varinterp=require("ndarray-linear-interpolate")varx=ndarray(newFloat32Array(9),[3,3])x.set(1,1,1.0)for(varu=0.0,u<=3.0;u+=0.25){varrow=[]for(varv=0.0;v<=3.0;v+=0.25){row.push(interp(x,u,v))}console.log(row.join(" "))}//Prints out://// 0 0 0 0 0 0 0 0 0 0 0 0 0// 0 0.0625 0.125 0.1875 0.25 0.1875 0.125 0.0625 0 0 0 0 0// 0 0.125 0.25 0.375 0.5 0.375 0.25 0.125 0 0 0 0 0// 0 0.1875 0.375 0.5625 0.75 0.5625 0.375 0.1875 0 0 0 0 0// 0 0.25 0.5 0.75 1 0.75 0.5 0.25 0 0 0 0 0// 0 0.1875 0.375 0.5625 0.75 0.5625 0.375 0.1875 0 0 0 0 0// 0 0.125 0.25 0.375 0.5 0.375 0.25 0.125 0 0 0 0 0// 0 0.0625 0.125 0.1875 0.25 0.1875 0.125 0.0625 0 0 0 0 0// 0 0 0 0 0 0 0 0 0 0 0 0 0// 0 0 0 0 0 0 0 0 0 0 0 0 0// 0 0 0 0 0 0 0 0 0 0 0 0 0// 0 0 0 0 0 0 0 0 0 0 0 0 0// 0 0 0 0 0 0 0 0 0 0 0 0 0//
npm install ndarray-linear-interpolateInterpolates values on an ndarray.
arraythe array to interpolate fromx, y, z...the coordinate to evaluate the interpolated grid at
Returns The multilinearly interpolated value
Note To avoid the overhead of variable arguments, special interfaces are available for 1, 2 and 3 dimensions. You can access these using:
require("ndarray-linear-interpolate").d1require("ndarray-linear-interpolate").d2require("ndarray-linear-interpolate").d3
(c) 2013 Mikola Lysenko. MIT License
About
Multilinear interpolation for ndarrays
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
No releases published
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.