Documentation ¶
Overview ¶
Package cbspline implements the Cubic Spline Interpolation algorithm.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidData = errors.New("invalid data")
ErrInvalidData is an error thrown when the given parameters are not appropriate and the cubic spline curve can not be determined.
Functions ¶
This section is empty.
Types ¶
type CbSpline ¶
type CbSpline struct {
// contains filtered or unexported fields
}
CbSpline represents a cubic spline curve.
func New ¶
New creates and returns a cubic spline. t and v are the list of data points, and each element in them represents S(t[i]) = v[i]. t and v must be exactly the same length, and t must be sorted in ascending order.
Elements of t with the same value can appear up to two times in a row, only if the corresponding v elements are also equivalent. If different v values are specified for the same t, or if the same t appears more than twice, it will probably return an error.
BUG(tunabay): Currently b=Cyclic does not seem to work at all. Find out the correct algorithm.
Notes ¶
Bugs ¶
Currently b=Cyclic does not seem to work at all. Find out the correct algorithm.