Scad_ml.CubicSplineCubic spline interpolation of 2d paths.
This is a port of a javascript implementation underlying a spline visualization tool by Timo Denk.
Boundary condition for cubic spline fitting.
Calculated coefficients along with the X ranges that they apply to. Abstracted to protect array access
val len : t -> intlen t
Length of the X range and coefficient arrays stored in t.
val xmins : t -> float listxmins t
Minimum X values to which the coefficients at the same indices within t apply.
val xmaxs : t -> float listxmaxs t
Maximum X values to which the coefficients at the same indices within t apply.
val get_xmin : t -> int -> float optionval get_xmax : t -> int -> float optionval get_xmin_exn : t -> int -> floatval get_xmax_exn : t -> int -> floatfit ?boundary ps
Calculate cubic spline coefficients with the boundary condition (defaults to `Natural) for the 2-dimensional control points ps.
val extrapolate : t -> float -> float optionextrapolate t x
Calculate the corresponding dependent value (e.g. Some y) for the given independent value x using the cubic spline fit coefficient in t. If x does not fall within the range of the control values used to generate t, None is returned.
extrapolate_path t xs
Use t to extrapolate xs into a 2-dimensional cubic spline path.
interpolate_path t n
Use t to interpolate 2-dimensional cubic spline path with n evently spaced points.
val coef_to_string : coef -> stringcoef_to_string c
Show contents of c as a string.