Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hughsk/bicubic-sample
Conveniently interpolate arbitrary 2D grids using bicubic interpolation
https://github.com/hughsk/bicubic-sample
Last synced: 8 days ago
JSON representation
Conveniently interpolate arbitrary 2D grids using bicubic interpolation
- Host: GitHub
- URL: https://github.com/hughsk/bicubic-sample
- Owner: hughsk
- License: mit
- Created: 2013-10-28T11:42:50.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2013-10-28T11:44:07.000Z (about 11 years ago)
- Last Synced: 2024-10-17T16:39:46.955Z (22 days ago)
- Language: JavaScript
- Size: 109 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# bicubic-sample [![experimental](http://hughsk.github.io/stability-badges/dist/experimental.svg)](http://github.com/hughsk/stability-badges) #
Conveniently interpolate arbitrary 2D grids using bicubic interpolation.
## Usage ##
[![bicubic-sample](https://nodei.co/npm/bicubic-sample.png?mini=true)](https://nodei.co/npm/bicubic-sample)
### `sample = require('bicubic-sample')(getter)` ###
Returns a `sample` function that you can pass points to.
`getter` is a function which takes an `x` and `y` argument and should return
the value at that point in space. These values will both always be integers.### `sample(x, y)` ###
You can now pass any pair of x/y values to `sample` and get an interpolated
result.`sample(0,0)` is the equivalent of `getter(0,0)`, however if you were to call
`sample(0.5,0.5)` the result would be a smooth and curvy interpolation between
the surrounding points.## License ##
MIT. See [LICENSE.md](http://github.com/hughsk/bicubic-sample/blob/master/LICENSE.md) for details.