https://github.com/bast/bilinear
Bilinear interpolation library.
https://github.com/bast/bilinear
Last synced: about 1 year ago
JSON representation
Bilinear interpolation library.
- Host: GitHub
- URL: https://github.com/bast/bilinear
- Owner: bast
- License: mpl-2.0
- Created: 2022-07-26T11:24:38.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-07-26T12:55:21.000Z (almost 4 years ago)
- Last Synced: 2025-01-28T02:42:49.030Z (over 1 year ago)
- Language: Rust
- Size: 10.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Bilinear interpolation
https://en.wikipedia.org/wiki/Bilinear_interpolation
## How to use it
Needs to be documented but currently the best might be to have a look at
[tests/integration_tests.rs](tests/integration_tests.rs) on how I insert the
data and then obtain approximate values.
I first want to test it a bit in another project to stabilize/sharpen the API
and then I will document in detail how to set it up and evaluate.
## Input data can have "holes"
When interpolating, the code first finds the right "tile", then checks that we
have data available for all 4 corners. If yes, then the value is interpolated
and used. If one or more of the 4 corner values are missing, then the function
evaluates to `None`.
## Code development
Testing the code:
```
$ cargo test --release -- --nocapture
```
## Implementation notes
- `HashMap` turned out significantly faster compared to
`HashMap<(usize, usize), f64>`, both when creating and evaluating.