Interpolate

Trait Interpolate 

Source
pub trait Interpolate<S> {
    // Required method
    fn interpolate(&self, other: &Self, amount: S) -> Self;
}
Expand description

Trait used for interpolation of values

§Type parameters:

  • S: The scalar type used for amount

Required Methods§

Source

fn interpolate(&self, other: &Self, amount: S) -> Self

Interpolate between self and other, using amount to calculate how much of other to use.

§Parameters:
  • amount: amount in the range 0. .. 1.
  • other: the other value to interpolate with
§Returns

A new value approximately equal to self * (1. - amount) + other * amount.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<S> Interpolate<S> for Quaternion<S>
where S: BaseFloat,

Source§

fn interpolate(&self, other: &Quaternion<S>, amount: S) -> Quaternion<S>

Source§

impl<S> Interpolate<S> for Basis2<S>
where S: BaseFloat,

Source§

fn interpolate(&self, other: &Basis2<S>, amount: S) -> Basis2<S>

Source§

impl<S> Interpolate<S> for Basis3<S>
where S: BaseFloat,

Source§

fn interpolate(&self, other: &Basis3<S>, amount: S) -> Basis3<S>

Source§

impl<V, R> Interpolate<<V as VectorSpace>::Scalar> for Decomposed<V, R>

Source§

fn interpolate( &self, other: &Decomposed<V, R>, amount: <V as VectorSpace>::Scalar, ) -> Decomposed<V, R>

Implementors§