Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mthh/rbf_interp
https://github.com/mthh/rbf_interp
interpolation radial-basis-function rust-library
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mthh/rbf_interp
- Owner: mthh
- License: mit
- Created: 2017-08-07T11:31:43.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-08-07T13:09:56.000Z (over 7 years ago)
- Last Synced: 2024-10-15T02:22:19.523Z (3 months ago)
- Topics: interpolation, radial-basis-function, rust-library
- Language: Rust
- Size: 6.84 KB
- Stars: 4
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rbf_interp
[![Build Status](https://travis-ci.org/mthh/rbf_interp.svg?branch=master)](https://travis-ci.org/mthh/rbf_interp)Rust library for *Radial Basis Function Interpolation*.
**Want to interpolate from a set of known points at any point:**
```rust
let obs_pts = vec![Pt::new(0.0, 0.0, 0.0),
Pt::new(0.0, 100.0, 6.0),
Pt::new(75.0, 25.0, 3.1),
Pt::new(100.0, 75.0, 7.4)];
let rbf = Rbf::new(&obs_pts, "linear", None);
// Compute the value at point (0.0, 50.0) :
let interpolated_value = rbf.interp_point((0.0, 50.0));
```**Want to interpolate from a set of known points on a regular grid:**
```rust
let obs_points_two_stocks = vec![Pt::new(3.5, 3.5, 100.0), Pt::new(6.5, 6.5, 100.0)];
// Define the bbox as xmin, xmax, ymin, ymax:
let bbox = Bbox::new(0.0, 10.0, 0.0, 10.0);
// Define the resolution on x and y axis:
let (reso_x, reso_y) = (40, 40);
// Get a vector of point with the interpolated value:
let res_rbf = rbf_interpolation(reso_x,
reso_y,
&bbox,
&obs_points_two_stocks,
"inverse_multiquadratic",
Some(1.66))
```Various radial basis function are implemented :
"linear", "cubic", "thin_plate", "quintic", "gaussian", "multiquadratic" and "inverse_multiquadratic".## Usage
```rust
[dependencies]
rbf_interp = "0.1"
```## Example with gnuplot
```
cargo run --example plot
```