Skip to main content

Lerp

Trait Lerp 

Source
pub trait Lerp: Clone {
    // Required method
    fn lerp(a: &Self, b: &Self, t: f64) -> Self;
}
Expand description

A value that supports linear component-wise interpolation.

t = 0.0 returns a clone of a; t = 1.0 returns a clone of b.

Implementations for (f64, f64) and (f64, f64, f64) are added in issue #351.

Required Methods§

Source

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

Linearly interpolates between a and b by the factor t.

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 Lerp for (f64, f64)

Source§

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

Source§

impl Lerp for (f64, f64, f64)

Source§

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

Source§

impl Lerp for f64

Source§

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

Implementors§