pub trait SampleDerivative<T>: Curve<T>where
T: HasTangent,{
// Required method
fn sample_with_derivative_unchecked(&self, t: f32) -> WithDerivative<T>;
// Provided methods
fn sample_with_derivative(&self, t: f32) -> Option<WithDerivative<T>> { ... }
fn sample_with_derivative_clamped(&self, t: f32) -> WithDerivative<T> { ... }
}Expand description
A trait for curves that can sample derivatives in addition to values.
Types that implement this trait automatically implement CurveWithDerivative;
the curve produced by with_derivative uses the sampling defined in the trait
implementation.
Required Methods§
Sourcefn sample_with_derivative_unchecked(&self, t: f32) -> WithDerivative<T>
fn sample_with_derivative_unchecked(&self, t: f32) -> WithDerivative<T>
Sample this curve at the parameter value t, extracting the associated value
in addition to its derivative. This is the unchecked version of sampling, which
should only be used if the sample time t is already known to lie within the
curve’s domain.
See Curve::sample_unchecked for more information.
Provided Methods§
Sourcefn sample_with_derivative(&self, t: f32) -> Option<WithDerivative<T>>
fn sample_with_derivative(&self, t: f32) -> Option<WithDerivative<T>>
Sample this curve’s value and derivative at the parameter value t, returning
None if the point is outside of the curve’s domain.
Sourcefn sample_with_derivative_clamped(&self, t: f32) -> WithDerivative<T>
fn sample_with_derivative_clamped(&self, t: f32) -> WithDerivative<T>
Sample this curve’s value and derivative at the parameter value t, clamping t
to lie inside the domain of the curve.