[][src]Trait splines::interpolate::Interpolate

pub trait Interpolate<T>: Sized + Copy {
    fn lerp(a: Self, b: Self, t: T) -> Self;

    fn cubic_hermite(
        _: (Self, T),
        a: (Self, T),
        b: (Self, T),
        _: (Self, T),
        t: T
    ) -> Self { ... } }

Keys that can be interpolated in between. Implementing this trait is required to perform sampling on splines.

T is the variable used to sample with. Typical implementations use f32 or f64, but you’re free to use the ones you like. Feel free to have a look at Spline::sample for instance to know which trait your type must implement to be usable.

Required methods

fn lerp(a: Self, b: Self, t: T) -> Self

Linear interpolation.

Loading content...

Provided methods

fn cubic_hermite(
    _: (Self, T),
    a: (Self, T),
    b: (Self, T),
    _: (Self, T),
    t: T
) -> Self

Cubic hermite interpolation.

Default to lerp.

Loading content...

Implementations on Foreign Types

impl Interpolate<f32> for f32[src]

impl Interpolate<f64> for f64[src]

impl Interpolate<f32> for f64[src]

impl Interpolate<f64> for f32[src]

Loading content...

Implementors

Loading content...