[−][src]Trait splines::interpolate::Interpolate
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.
Provided methods
fn cubic_hermite(
_: (Self, T),
a: (Self, T),
b: (Self, T),
_: (Self, T),
t: T
) -> Self
_: (Self, T),
a: (Self, T),
b: (Self, T),
_: (Self, T),
t: T
) -> Self
Cubic hermite interpolation.
Default to lerp
.
Implementations on Foreign Types
impl Interpolate<f32> for f32
[src]
fn lerp(a: Self, b: Self, t: f32) -> Self
[src]
fn cubic_hermite(
x: (Self, f32),
a: (Self, f32),
b: (Self, f32),
y: (Self, f32),
t: f32
) -> Self
[src]
x: (Self, f32),
a: (Self, f32),
b: (Self, f32),
y: (Self, f32),
t: f32
) -> Self
impl Interpolate<f64> for f64
[src]
fn lerp(a: Self, b: Self, t: f64) -> Self
[src]
fn cubic_hermite(
x: (Self, f64),
a: (Self, f64),
b: (Self, f64),
y: (Self, f64),
t: f64
) -> Self
[src]
x: (Self, f64),
a: (Self, f64),
b: (Self, f64),
y: (Self, f64),
t: f64
) -> Self
impl Interpolate<f32> for f64
[src]
fn lerp(a: Self, b: Self, t: f32) -> Self
[src]
fn cubic_hermite(
(x, xt): (Self, f32),
(a, at): (Self, f32),
(b, bt): (Self, f32),
(y, yt): (Self, f32),
t: f32
) -> Self
[src]
(x, xt): (Self, f32),
(a, at): (Self, f32),
(b, bt): (Self, f32),
(y, yt): (Self, f32),
t: f32
) -> Self
impl Interpolate<f64> for f32
[src]
fn lerp(a: Self, b: Self, t: f64) -> Self
[src]
fn cubic_hermite(
(x, xt): (Self, f64),
(a, at): (Self, f64),
(b, bt): (Self, f64),
(y, yt): (Self, f64),
t: f64
) -> Self
[src]
(x, xt): (Self, f64),
(a, at): (Self, f64),
(b, bt): (Self, f64),
(y, yt): (Self, f64),
t: f64
) -> Self