[][src]Function cubic_spline::calc_spline

pub fn calc_spline(points: &Points, opts: &SplineOpts) -> Result<Points>

The main function that does all the work.

Returns points of curve constructed within the range of passed points using cubic spline interpolation.


use cubic_spline::{Points, TryFrom, SplineOpts};

let src_points = vec![(1.0, 1.0), (3.3, 2.7), (5.1, 0.9)];
let prepared_points = Points::try_from(&src_points).expect("cant convert points");

let options = SplineOpts::new()

let calculated_points = prepared_points
  .expect("cant construct spline points");

assert_eq!(calculated_points.get_ref().len(), 33);