pub fn make_spline2d<T>(
typ: &str,
xa: &[T],
ya: &[T],
za: &[T],
) -> Result<DynSpline2d<T>, InterpolationError>
Expand description
Creates a DynSpline2d
of typ
type.
Useful when typ
is not known at compile time.
ยงExample
let xa = [0.0, 1.0, 2.0, 3.0];
let ya = [0.0, 2.0, 4.0, 6.0];
// z = x + y, in column-major order
let za = [
0.0, 1.0, 2.0, 3.0,
2.0, 3.0, 4.0, 5.0,
4.0, 5.0, 6.0, 7.0,
6.0, 7.0, 8.0, 9.0,
];
let typ = "bicubic";
let spline = make_spline2d(typ, &xa, &ya, &za)?;