# ndarray-linear-interpolate

> Multilinear interplation for ndarrays

Latest version **1.0.0** (published 2014-04-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install ndarray-linear-interpolate
pnpm add ndarray-linear-interpolate
yarn add ndarray-linear-interpolate
bun add ndarray-linear-interpolate
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2014-04-29 |
| First published | 2013-05-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 16 |
| Author | Mikola Lysenko |
| Maintainers | mikolalysenko |
| Keywords | ndarray, linear, multilinear, bilinear, trilinear, interpolate, grid, image, volume, density |

## Links

- npm: https://www.npmjs.com/package/ndarray-linear-interpolate
- Repository: https://github.com/mikolalysenko/ndarray-linear-interpolate
- Issues: https://github.com/mikolalysenko/ndarray-linear-interpolate/issues
- npm.io page: https://npm.io/package/ndarray-linear-interpolate

## Alternatives

- [@lexical/table](https://npm.io/package/@lexical/table.md) — 3.0M weekly downloads
- [mantine-datatable](https://npm.io/package/mantine-datatable.md) — 98.2K weekly downloads
- [react-native-collapsible-tab-view](https://npm.io/package/react-native-collapsible-tab-view.md) — 70.6K weekly downloads
- [@handsontable/vue3](https://npm.io/package/@handsontable/vue3.md) — 16.1K weekly downloads
- [vuewordcloud](https://npm.io/package/vuewordcloud.md) — 7.2K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2014-04-29
- 0.0.2 — 2013-11-29
- 0.0.1 — 2013-06-26
- 0.0.0 — 2013-05-14

## README

ndarray-linear-interpolate
==========================
Multilinear (ie [bilinear](http://en.wikipedia.org/wiki/Bilinear_interpolation)/[trilinear](http://en.wikipedia.org/wiki/Trilinear_interpolation)) interpolation for ndarrays.

Example
=======

```javascript
var ndarray = require("ndarray")
var interp = require("ndarray-linear-interpolate")

var x = ndarray(new Float32Array(9), [3, 3])
x.set(1, 1, 1.0)

for(var u=0.0, u<=3.0; u+=0.25) {
  var row = []
  for(var v=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
//
```

# Install

    npm install ndarray-linear-interpolate
    
### `require("ndarray-linear-interpolate")(array, x, y, z, ...)`
Interpolates values on an ndarray.

* `array` the array to interpolate from
* `x, 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").d1`
* `require("ndarray-linear-interpolate").d2`
* `require("ndarray-linear-interpolate").d3`


# Credits
(c) 2013 Mikola Lysenko. MIT License

---
_Source: https://npm.io/package/ndarray-linear-interpolate · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
