Skip to main content

Interpolable

Trait Interpolable 

Source
pub trait Interpolable {
    // Required method
    fn lerp(&self, other: Self, t: f64) -> Self;
}
Expand description

A trait for types that support linear interpolation between two values.

Required Methods§

Source

fn lerp(&self, other: Self, t: f64) -> Self

Performs linear interpolation between self and other by the factor t.

§Arguments
  • f64 - The interpolation factor, typically in the range 0.0 to 1.0.
  • Self - The target value to interpolate towards.
§Returns
  • Self - The interpolated result.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Interpolable for f64

Implements the Interpolable trait for f64.

Source§

fn lerp(&self, other: f64, t: f64) -> f64

Implementors§

Source§

impl Interpolable for Vector2D

Implements Interpolable for Vector2D.

Source§

impl Interpolable for Vector3D

Implements Interpolable for Vector3D.