Interpolation method for computation of cubic spline points within the range of a discrete set of known points.
For information on how a curve can be constructed and which points to accept, see the appropriate structures.
If you already have some points you can implement
From trait for
struct and pass your points directly.
It also compiled as wasm module. And you can use it in your js code but not completely. Now available only one function
import from 'cubic-spline-rs' const NUM_OF_SEGMENTS = 22 const points = const curvePoints =
If you want to draw result points to canvas - code like this:
const ctx = ctx. ctx. = 3 ctx. = '#ffcc00' ctx. const length = curvePoints. - 1 ctx. ctx.
||Number of calculated points between known points|
||A point that will not be drawn, but the beginning of the graph will bend as if it is there.|
||A point that will not be drawn, but the end of the graph will bend as if it is there.|
This module is MIT licensed.