Module interp2d

Module interp2d 

Source
Expand description

Two-dimensional interpolation.

§Example

use interp::interp2d::Interp2D;

let grid = ndarray::array![
    [0.0f64, 0.0, 0.0],
    [0.0, 1.0, 0.0],
    [0.0, 0.0, 0.0]
];
let xs = vec![0.0, 1.0, 2.0];
let ys = vec![3.0, 4.0, 5.0];

// Create interpolator struct.
let interp = Interp2D::new(xs, ys, grid);

// Evaluate the interpolated data at some point.
assert!((interp.eval_no_extrapolation((1.0, 4.0)).unwrap() - 1.0).abs() < 1e-6);

Structs§

Interp2D
Two dimensional bilinear interpolator for data on an irregular grid.