Trait bspline::Interpolate
[−]
[src]
pub trait Interpolate { fn interpolate(&self, other: &Self, t: f32) -> Self; }
The interpolate trait is used to linearly interpolate between two types (or in the case of Quaternions, spherically linearly interpolate). The B-spline curve uses this trait to compute points on the curve for the given parameter value.
A default implementation of this trait is provided for all T
that are Mul<f32, Output = T> + Add<Output = T> + Copy
since the interpolation provided by the trait is expected to be
a simple linear interpolation.
Required Methods
fn interpolate(&self, other: &Self, t: f32) -> Self
Linearly interpolate between self
and other
using t
, for example with floats:
self * (1.0 - t) + other * t
If the result returned is not a correct linear interpolation of the values the curve produced using the value may not be correct.