Trait Lerp

Source
pub trait Lerp {
    type Scalar;

    // Required method
    fn lerp(&self, other: &Self, scalar: &Self::Scalar) -> Self;
}
Expand description

Describes a type that can linearly interpolate between two points.

Required Associated Types§

Source

type Scalar

The scaling type for linear interpolation.

Required Methods§

Source

fn lerp(&self, other: &Self, scalar: &Self::Scalar) -> Self

Given self and another point other, return a point on a line running between the two that is scalar fraction of the distance between the two points.

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 f32

Source§

type Scalar = f32

Source§

fn lerp(&self, other: &f32, scalar: &f32) -> f32

Source§

impl Lerp for f64

Source§

type Scalar = f64

Source§

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

Source§

impl Lerp for i8

Source§

type Scalar = f32

Source§

fn lerp(&self, other: &i8, scalar: &f32) -> i8

Source§

impl Lerp for i16

Source§

type Scalar = f32

Source§

fn lerp(&self, other: &i16, scalar: &f32) -> i16

Source§

impl Lerp for i32

Source§

type Scalar = f32

Source§

fn lerp(&self, other: &i32, scalar: &f32) -> i32

Source§

impl Lerp for i64

Source§

type Scalar = f64

Source§

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

Source§

impl Lerp for u8

Source§

type Scalar = f32

Source§

fn lerp(&self, other: &u8, scalar: &f32) -> u8

Source§

impl Lerp for u16

Source§

type Scalar = f32

Source§

fn lerp(&self, other: &u16, scalar: &f32) -> u16

Source§

impl Lerp for u32

Source§

type Scalar = f32

Source§

fn lerp(&self, other: &u32, scalar: &f32) -> u32

Source§

impl Lerp for u64

Source§

type Scalar = f64

Source§

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

Source§

impl<T> Lerp for [T; 1]
where T: Lerp,

Source§

type Scalar = <T as Lerp>::Scalar

Source§

fn lerp(&self, other: &Self, scalar: &Self::Scalar) -> Self

Source§

impl<T> Lerp for [T; 2]
where T: Lerp,

Source§

type Scalar = <T as Lerp>::Scalar

Source§

fn lerp(&self, other: &Self, scalar: &Self::Scalar) -> Self

Source§

impl<T> Lerp for [T; 3]
where T: Lerp,

Source§

type Scalar = <T as Lerp>::Scalar

Source§

fn lerp(&self, other: &Self, scalar: &Self::Scalar) -> Self

Source§

impl<T> Lerp for [T; 4]
where T: Lerp,

Source§

type Scalar = <T as Lerp>::Scalar

Source§

fn lerp(&self, other: &Self, scalar: &Self::Scalar) -> Self

Source§

impl<T> Lerp for [T; 5]
where T: Lerp,

Source§

type Scalar = <T as Lerp>::Scalar

Source§

fn lerp(&self, other: &Self, scalar: &Self::Scalar) -> Self

Implementors§