Skip to main content

FloatExt

Trait FloatExt 

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

An extension trait for float primitives.

Required Methods§

Source

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

Computes the linear interpolation between self and other based on the value t.

When t is 0.0, the result is self. When t is 1.0, the result is other. When t is outside of the range [0.0, 1.0], the result is linearly extrapolated.

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 FloatExt for f32

Source§

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

Source§

impl FloatExt for f64

Source§

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

Implementors§