Function make_spline
Source pub fn make_spline<T>(
typ: &str,
xa: &[T],
ya: &[T],
) -> Result<DynSpline<T>, InterpolationError>
Expand description
Creates a DynSpline
of typ
type.
Useful when typ
is not known at compile time.
ยงExample
let xa = [0.0, 1.0, 2.0, 3.0, 4.0];
let ya = [0.0, 2.0, 4.0, 6.0, 8.0];
let typ = "cubic";
let spline = make_spline(typ, &xa, &ya)?;