Skip to content

hughsk/bicubic-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

bicubic-sample experimental

Conveniently interpolate arbitrary 2D grids using bicubic interpolation.

Usage

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 for details.

About

Conveniently interpolate arbitrary 2D grids using bicubic interpolation

Resources

License

Stars

Watchers

Forks

Packages

No packages published