Module splines::interpolate
source · Expand description
The Interpolate
trait and associated symbols.
The Interpolate
trait is the central concept of the crate. It enables a spline to be
sampled at by interpolating in between control points.
In order for a type to be used in Spline<K, V>
, some properties must be met about the K
type must implementing several traits:
One
, giving a neutral element for the multiplication monoid.Additive
, making the type additive (i.e. one can add or subtract with it).Linear
, unlocking linear combinations, required for interpolating.Trigo
, a trait giving π and cosine, required for e.g. cosine interpolation.
Feel free to have a look at current implementors for further help.
Why doesn’t this crate use num-traits instead of defining its own traits?
The reason for this is quite simple: this crate provides a no_std
support, which is not
currently available easily with num-traits. Also, if something changes in num-traits with
those traits, it would make this whole crate unstable.
Traits
- Values that can be interpolated. Implementing this trait is required to perform sampling on splines.
- Types that can be used as interpolator in splines.